본문 바로가기
728x90
반응형

Git21

Git의 원리] 7. git tag 기본 사용법 특정 commit에 tag(어떤 것으로든 지정할 수 있지만, 주로 배포 버전)를 지정하여 관리할 수 있는 기능이다. tag에는 Annotated Tag와 Lightweight Tag가 있다. git 초기화한다. $ git init Initialized empty Git repository in C:/Project/git_test/.git/ 파일을 생성하고 저장하여 commit한다. $ vim f1.txt $ git add f1.txt warning: LF will be replaced by CRLF in f1.txt. The file will have its original line endings in your working directory $ git commit -m 1 [master (root-co.. 2022. 9. 8.
Git의 원리] 6. git remote, origin, push $ git init Initialized empty Git repository in C:/Project/git_test/.git/ git 초기화를 하면 생성되는 .git파일의 config파일을 확인해보자. [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true f1.txt파일을 생성해서 저장 commit하고, git remote add [원격저장소] [remote repository url] 명령어를 통해서 원격저장소를 연결하고 원격저장소 이름과, url을 지정한다. $ vim f1.txt $ git add f1.txt warning: LF.. 2022. 9. 7.
Git의 원리] 5. git merge, conflict (TortoiseGit) 2개의 branch에서 동일한 파일을 수정한 다음, merge 하는 경우 git은 자동 merge를 할 수 없어서 conflict를 발생시킨다. 이때 어떻게 conflict를 처리할 수 있는지 알아보자. # git_test directory를 git 초기화한다. $ git init Initialized empty Git repository in C:/Project/git_test/.git/ # f1.txt파일을 생성하고 간단한 소스를 입력하고 저장한다. $ vim f1.txt # f1.txt파일을 add하고 commit한다. $ git add f1.txt warning: LF will be replaced by CRLF in f1.txt. The file will have its original line.. 2022. 9. 6.
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.
728x90
반응형