Git - An Introduction
-
Upload
krishnamoorthy-arvind -
Category
Documents
-
view
28 -
download
2
Transcript of Git - An Introduction
![Page 1: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/1.jpg)
Git An Introduction
K. ARVIND Overture Networks
December 2013
DRAWS LIBERALLY FROM VARIOUS ONLINE RESOURCES, ESPECIALLY SCOTT CHACON’s EXCELLENT BOOK ON GIT
![Page 2: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/2.jpg)
● What is Git?
● How is Git different?
● Giit conceptual overview
○ Hashes, Repository, Branching
Plan
![Page 3: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/3.jpg)
• Distributed Version Control System
• Linux Community
• 2005
What is Git?
![Page 4: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/4.jpg)
● Single server that contains versioned files
● Clients have version being worked on
● Easy to administer
● Single point of failure
● Need connectivity to commit
● Subversion, CVS, Perforce
Centralized VCS
![Page 5: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/5.jpg)
Distributed VCS
● Every client has the full repository
● Central repository may also be used
● Local commits followed by push
● Fault Tolerant
● Work off-line
![Page 6: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/6.jpg)
Why Git?
● Fast
● Simple
● Branching
● Fully distributed
● Scales well
![Page 7: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/7.jpg)
No Deltas!
![Page 8: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/8.jpg)
Dog ate cable - No problem!
Nearly every operation is local!
![Page 9: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/9.jpg)
Name is a Digest
Git object name = SHA-1 hash of contents
Built-in integrity check
![Page 10: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/10.jpg)
Cryptographic Digest
![Page 11: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/11.jpg)
Commit Hash: Git Bash SOME PROPRIETARY INFORMATION REDACTED BELOW
![Page 12: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/12.jpg)
Digest “uniqueness” is “real”! SOME PROPRIETARY INFORMATION REDACTED BELOW
![Page 13: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/13.jpg)
Commit Hash - Gitk SOME PROPRIETARY INFORMATION REDACTED BELOW
![Page 14: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/14.jpg)
Commit Hash: TortoiseGit SOME PROPRIETARY INFORMATION REDACTED BELOW
![Page 15: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/15.jpg)
Git Objects
![Page 16: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/16.jpg)
Commit History
![Page 17: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/17.jpg)
Git Repository
![Page 18: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/18.jpg)
Git Repository
![Page 19: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/19.jpg)
Git repository
![Page 20: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/20.jpg)
Branch - Pointer to a commit
● HEAD - points to current branch
● master - default branch
![Page 21: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/21.jpg)
No branches added
![Page 22: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/22.jpg)
Add a branch
gitbash> git branch testing f30ab
HEAD still points to master
![Page 23: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/23.jpg)
Switch to branch
gitbash> git checkout testing
HEAD has moved to testing
![Page 24: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/24.jpg)
Commit on branch
testing points to new commit
HEAD still points to testing
![Page 25: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/25.jpg)
Switch back to master branch
gitbash> git checkout master
HEAD points to master now
![Page 26: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/26.jpg)
Commit on master
Diverging branches - need to merge
later
![Page 27: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/27.jpg)
Merge
gitbash> git merge iss53
Preferred alternative: git rebase
![Page 28: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/28.jpg)
Pulling remote branches
![Page 29: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/29.jpg)
Conclusion
● Conceptual overview
● Many key concepts
● Free resources available online for further
study:
● ProGit by Scott Chacon - http://git-scm.com/book
![Page 30: Git - An Introduction](https://reader031.fdocuments.in/reader031/viewer/2022032002/55b367ebbb61ebef6d8b46d1/html5/thumbnails/30.jpg)
Thank you Scott Chacon!