seminar paco @ 2021.03.23
목차 git Github 기본적인명령어들 Pull Request
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and ef iciency f source
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and ef iciency f source
- 왜쓸까? -
source
버전관리란? source
버전관리란? 1. 소스코드의변경사항을추적 2. 원활한협업수단제공 source
버전관리란? 1. 소스코드의변경사항을추적 2. 원활한협업수단제공 3. 저장소역할 source
버전관리툴은다양하다 Apache Subversion (SVN) Mercurial Concurrent Versions System (CVS) GNU Bazaar 등등많더라구요
버전관리툴은다양하다 Distributed?? Apache Subversion (SVN) Mercurial Concurrent Versions System (CVS) GNU Bazaar 등등많더라구요
버전관리툴은다양하다 Apache Subversion (SVN) Mercurial Distributed?? 참고 1 ( 블로그 ) 참고 2 ( 위키피디아 ) Concurrent Versions System (CVS) GNU Bazaar 등등많더라구요
source
GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.
GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. git 을이용해협업을용이하게해주는플랫폼! 많은프로젝트들의 central repository 를호스팅하고있다
GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. git 을이용해협업을용이하게해주는플랫폼! 많은프로젝트들의 central repository 를호스팅하고있다 source source source
기본적인명령어들
git workflow source
git add git add [options] <path> - Add file contents to the index - index! -A all -p patch -e edit
git commit git commit [options] - record changes to the repository - repository -a amend -m <msg> message=<msg>
About Commit Messages source
About Commit Messages 여러개발자들이협업을하는경우 commit message 의틀을맞추어두는경우가많 다. source
About Commit Messages 여러개발자들이협업을하는경우 commit message 의틀을맞추어두는경우가많 다. 변화를쉽게파악 로그자동생성 source
About Commit Messages 여러개발자들이협업을하는경우 commit message 의틀을맞추어두는경우가많 다. 변화를쉽게파악 로그자동생성 노션페이지참고하기!! source
git add. 가습관이되셨나요? 습관이되셨다면바람직하지않습니다!!
git add. 가습관이되셨나요? 습관이되셨다면바람직하지않습니다!! Q: 현재 directory 에있는모든변경사항들이한 commit 에들어갈만한내용인가??
git add. 가습관이되셨나요? 습관이되셨다면바람직하지않습니다!! Q: 현재 directory 에있는모든변경사항들이한 commit 에들어갈만한내용인가?? 1. feature A 기능개발시작 2. feature A에서사용해야하는 feature B에서버그발견 3. feature B 버그수정 4. feature A 기능구현
git branch git branch [options] - List, create, or delete branches - -d delete -l list -a all <branch-name>
feature branch git branch! feature/xxx source
git checkout git checkout [options] <branch commit> - Switch branches or restore working tree files - <commit> <branch-name> -b <filename>
git checkout git checkout [options] <branch commit> - Switch branches or restore working tree files - <commit> <branch-name> -b git checkout. 2019 8, git 2.23 switch restore. <filename>
git log git log [options] - Show commit logs - commit all decorate oneline graph source
git remote git remote <command> - Manage set of tracked repositories - repository add <name> <repository> remove <name> rename <old> <new> -v verbose
git push git push [options] <repository> - Update remote repository along with associated changes - repository -u set-upstream -d delete -f force
git pull git pull [options] <repository> - Fetch from and integrate with another repository or a local branch - repository local repository -r rebase
git merge git merge [options] - Join two or more development histories together - GitHub Pull Request!!
git merge - Fast Forward Merge - fast-forward 가능! source - Three Way Merge - fast-forward 불가능! Merge Commit 생김! source
Merge Conflicts File A 의 Line 1 수정 변경사항이다르다면어떤것을선택해야할까? File A 의 Line 1 수정 Merge Conflict!
Merge Conflicts 같은코드를수정하는것은불가피하지만, 피할수있으면피하자! 분업을통해일정부분해결가능
Common Workflow 1. feature branch 생성 2. 열심히개발 3. 적절한단위로 add & commit 4. remote 브랜치로 push 5. Pull Request 생성 6. Merge
Pull Request Description: Merge 하고자하는 branch 가반영한변경사항설명 Assignees: 해당기능을담당한유저 ( 들 ) Reviewers: Pull Request 를검토할유저 ( 들 ) Pull Request 생성이후에도 commit 추가가능! Files Changed와 Commit 탭을통해변경사항확인가능! 댓글달기가능! 파일둘러본뒤 Approve 가능!
Pull Request
Merge 이후에 Github 에서호스팅하는 Central Repository 가변경되었기때문에 로컬에있는 repository 와의동기화필요. 변경된브랜치로이동해 git pull 실행!
다루지못한명령어들 rm reset switch store rebase stash clone diff blame cherry-pick mv fetch init config 100 https://github.com/git/git/blob/master/git.c#l477-l615
질문있나요?
감사합니다