728x90 반응형 전체 글303 Git의 원리] 4. git stash branch 작업을 하다보면, 작업한 내용을 commit 하지 못한 채 다른 branch로 checkout을 해야하는 경우가 있다. 이때, git stash를 사용하여 작업한 내용을 보관하고, working directory를 reset할 수 있다. # git_test directory에서 git init을 한다. $ git init Initialized empty Git repository in C:/Project/git_test/.git/ # f1.txt 파일을 생성해서 a를 입력하고 저장한다. $ vim f1.txt # f1.txt 파일을 add한다. $ git add f1.txt warning: LF will be replaced by CRLF in f1.txt. The file will have.. 2022. 9. 6. GitLab CI/CD] 3. Openssh 설정, scp로 웹서버에 파일전송하기 GitLab서버에서 웹서버로 파일을 복사하기 위해서는 Openssh 설정이 필요하다. 1. GitLab 서버 로컬에 SSH Key를 생성한다. $ ssh-keygen -t rsa Enter file in which to save the key (/root/.ssh/id_rsa): # enter Created directory '/home/helloworld/.ssh'. Enter passphrase (empty for no passphrase): # enter Enter same passphrase again: # enter Your identification has been saved in /home/helloworld/.ssh/id_dsa. Your public key has been saved in.. 2022. 9. 6. Git의 원리] 3. git branch, merge # git_test directory를 git init한다. $ git init Initialized empty Git repository in C:/Project/git_test/.git/ # f1.txt파일을 추가 저장한다. $ vim f1.txt # 수정사항을 add 하고 '1' commit을 생성한다. $ git add . $ git commit -m '1' [master (root-commit) 689c9ed] 1 1 file changed, 1 insertion(+) create mode 100644 f1.txt # exp branch를 생성한다. master와 exp branch의 상태는 동일하다. $ git branch exp # exp branch로 checkout 한다음 f1.txt파일.. 2022. 8. 26. Git의 원리] 2. git commit (tree, commit) 1. Staging Area에 add한 파일을 commit 해보자 $ git status On branch master Changes to be committed: (use "git restore --staged ..." to unstage) new file: f1.txt new file: f2.txt new file: f3.txt $ git commit -m 'first commit!' [master bbaa106] first commit! 3 files changed, 3 insertions(+) create mode 100644 f1.txt create mode 100644 f2.txt create mode 100644 f3.txt $ git log commit bbaa10614a8afcb2e938.. 2022. 8. 25. Git의 원리] 1. git add (index, object, blob) 1. 테스트 프로젝트 생성 git을 test할 폴더를 선택하고 git init을 하여 git을 사용할 수 있도록 한다. 폴더 하위에 .git directory가 생성된다. object directory : all the content of your database refs directory : pointers into commit objects in that data (branches) HEAD file : 현재 check out된 branch git add시 생성되는 Index file : staging area information 2. 프로젝트 폴더에 'a'를 입력한 f1.txt 파일을 저장해보자. 3. f1.txt 파일을 git add하자. $ git add f1.txt .git\objects 경.. 2022. 8. 24. GitLab CI/CD] 2. Job(.gitlab-ci.yml) 등록하여 실행하기 1. .gitlab-ci.yml 파일 생성 Project > CI/CD > Editor > 원하는 branch 선택 > Create new CI/CD pipeline 클릭! Edit 화면에 아래와 같이 설정하고 Commit changes 클릭 test-job: # 임의로 지정한 JOB 이름 stage: test only: - test script: - echo "Hello World" # 실행할 스크립트 tags: - helloworld stage : test, build, deploy only : branch before_script : script실행전 작업 script : job script after_script : script실행후 작업 tags : runner tag 2. Job 실행결과 확인.. 2022. 8. 24. 이전 1 ··· 24 25 26 27 28 29 30 ··· 51 다음 728x90 반응형