git : part 1 overview & object model
DESCRIPTION
Git : Part 1 Overview & Object Model. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/1.jpg)
Git: Part 1Overview & Object Model
These slides were largely cut-and-pasted from http://excess.org/article/2008/07/ogre-git-tutorial/ ,
with some additions from other sources. I have deleted a lot from the cited tutorial, and recommend
that you listen to the entire tutorial on line, if you can.
![Page 2: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/2.jpg)
Who needs Git?
http://www.geekherocomic.com/2009/01/26/who-needs-git/
![Page 3: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/3.jpg)
Topics• What is Git?• SCM concepts used in Git• Git object model• Representation of Git objects as files• References
![Page 4: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/4.jpg)
Git• A collection of tools developed by Linux
kernel group for SCM– Now used by several other groups, and
apparently growing in popularity• Actually implements a replicated
versioned file system• Can be used to implement a variety of
software configuration management models and workflows
![Page 5: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/5.jpg)
Git Flavor• A collection of many tools• Evolved from scripts• Suited to a C programmer’s mentality• Everything is exposed and accessible• Very flexible– You can do anything the model permits– Including shooting yourself in the foot
• Need to understand the underlying model
![Page 6: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/6.jpg)
Git has a lot of commands• Learn a core subset of them• And one of the GUI tools (e.g., gitk)• Then learn the rest as you need them
![Page 7: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/7.jpg)
Groups of Git commands• Setup and branch management– init, checkout, branch
• Modify– add, delete, rename, commit
• Get information– status, diff, log
• Create reference points– tag, branch
![Page 8: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/8.jpg)
Source codecontains– Directories– Files
is the substance of a software configurationhttp://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 9: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/9.jpg)
RepositoryContains– files– commits
records history of changes to configurationhttp://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 10: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/10.jpg)
RepositoryContains– files– commits– ancestry relationships
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 11: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/11.jpg)
Ancestry relationshipsform a directed acyclic graph
(DAG)
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 12: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/12.jpg)
Ancestry graph featuresTags– identify versions of interest– including “releases”
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 13: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/13.jpg)
Ancestry graph features
HEAD– is current checkout– usually points to a branch
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 14: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/14.jpg)
Head may point to any commit In this case it is
said to be detached.
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 15: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/15.jpg)
Git componentsIndex– “staging area”– what is to be
committed
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 16: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/16.jpg)
History
A database, stored in directory “.git”.http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 17: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/17.jpg)
Staging area
Also stored in directory “.git”.http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 18: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/18.jpg)
Files you edit
Stored in the directory containing directory “.git”.
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 19: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/19.jpg)
Staging
add
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 20: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/20.jpg)
Committing
commit
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 21: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/21.jpg)
Checking out
checkout checkout
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 22: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/22.jpg)
Local Operations
add (stage) files
Working directory
Repository(.git directory)
Index (staging
area)
checkout the project
commit
![Page 23: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/23.jpg)
Object types• Blobs• Trees• Commits• Tags
![Page 24: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/24.jpg)
Git Object Model
http://book.git-scm.com/assets/images/figure/objects-example.png
![Page 25: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/25.jpg)
As UML class diagram
http://utsl.gen.nz/talks/git-svn/git-model.png
![Page 26: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/26.jpg)
Repository
![Page 27: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/27.jpg)
.git/objects|-- 23| ‘-- d4bd826aba9e29aaace9411cc175b784edc399|-- 76| ‘-- 49f82d40a98b1ba59057798e47aab2a99a11d3|-- c4| ‘-- aaefaa8a48ad4ad379dc1002b78f1a3e4ceabc|-- e7| ‘-- 4be61128eef713459ca4e32398d689fe80864e|-- info| ‘-- packs‘-- pack |-- pack-b7b026b1a0b0f193db9dea0b0d7367d25d3a68cc.idx ‘-- pack-b7b026b1a0b0f193db9dea0b0d7367d25d3a68cc.pack
loose
![Page 28: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/28.jpg)
Some other repository files• .git/config• .git/description – used by gitweb• .git/info/exclude – files to ignore• ...
![Page 29: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/29.jpg)
Repository object naming convention
“content addressable” (hashed)
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 30: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/30.jpg)
Data values determine hash
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 31: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/31.jpg)
Hash value is filename
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 32: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/32.jpg)
File contains data
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 33: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/33.jpg)
Blobs
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 34: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/34.jpg)
Trees
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 35: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/35.jpg)
Trees
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 36: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/36.jpg)
Trees
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 37: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/37.jpg)
Commits
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 38: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/38.jpg)
Commits
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 39: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/39.jpg)
Commits
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 40: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/40.jpg)
Commits
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 41: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/41.jpg)
Objects are immutable
http://edgyu.excess.org/git-tutorial/2008-07-09/intro-to-git.pdf
![Page 42: Git : Part 1 Overview & Object Model](https://reader035.vdocument.in/reader035/viewer/2022062410/56816439550346895dd60116/html5/thumbnails/42.jpg)
References• http://book.git-scm.com/index.html• http://excess.org/article/2008/07/ogre-git-tutorial/• http://www-cs-students.stanford.edu/~blynn/gitmagi
c/
• http://progit.org/book/• http://www.geekherocomic.com/2009/01/26/who-nee
ds-git/