Download - Git General
![Page 1: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/1.jpg)
Confidential and Proprietary
UNDERSTANDING GIT
Chen, ZhongkeMar 15, 2012
![Page 2: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/2.jpg)
Confidential and Proprietary
HISTORY
SCCS/RCS('70~'80)
• Single File
VSS('90)
• check-out/check-in
CVS('90)
• update/commit
SVN('00)
• atomic commit
TeamWare,BitKeeper, GIT,Mercurial,Bazaar
('00)
• Distributed?
Centralized
![Page 3: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/3.jpg)
Confidential and Proprietary
WHAT’S GIT
› Git is an open source version control system designed for speed and efficiency
distributed
› Initial developed by Linus Torvalds
› Used by e.g. Linux kernel and Ruby on Rails, Android
![Page 4: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/4.jpg)
Confidential and Proprietary
GIT CONCEPTS: REPOSITORY, REVISION, WORKING DIRECTORY, STAGE
![Page 5: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/5.jpg)
Confidential and Proprietary
EXERCISE 1
› git config --global user.name “zhongkchen”› git config --global user.email [email protected] › git init # create a new repository› git add # add file to stage› git rm› git mv› git commit # commit files from stage to repo› git status # check the status of working dir and stage› git log # check history in repo› git diff # compare working dir with stage › git diff --cached # compare stage with the repo› .gitignore # a special file
› Advanced: git stash, git blame, git reset, git revert
![Page 6: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/6.jpg)
Confidential and Proprietary
GIT CONCEPTS: BRANCH AND MERGE 1
![Page 7: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/7.jpg)
Confidential and Proprietary
GIT CONCEPTS: BRANCH AND MERGE 2
![Page 8: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/8.jpg)
Confidential and Proprietary
GIT CONCEPTS: BRANCH AND MERGE 3
![Page 9: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/9.jpg)
Confidential and Proprietary
EXERCISE 2
› git branch› git checkout› git merge› git branch -d
› Advanced: git rebase, git cherry-pick
![Page 10: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/10.jpg)
Confidential and Proprietary
GIT CONCEPTS: CLONE, FETCH, PUSH
![Page 11: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/11.jpg)
Confidential and Proprietary
EXERCISE 3
› git clone › git fetch origin› git merge› git push origin master› git pull
› advanced:– config file– git remote
![Page 12: Git General](https://reader036.vdocument.in/reader036/viewer/2022062319/55549a67b4c90502618b45ff/html5/thumbnails/12.jpg)
Confidential and Proprietary
REFERENCE
› Intro to Distributed Version Control Illustrated› Distributed Revision Control (Wikipedia)› Pro Git› Tech Talk: Linus Torvalds on git