on speed and efficiency • Usually runs as a CLI tool in your local machine • Stores entire repository (repo)/project on peer/node • Originally developed by Linus Torvalds and he handed over the maintenance to Junio Hamano after initial 6 months and Junio has been maintaining it from 2005 - (Talk by Linus on Git in Google May 2007) $ git --version git version 2.10.1 (Apple Git-78)
system with following goals: ◦ Track changes to the content ◦ Store content and safeguard it against corruption ◦ Distribute the content and history with collaborators
a simple model ◦ It stores snapshots of whole project directory and not diff ! ◦ It refers to each file by checksum ( SHA-1 ) of file-contents ◦ Repo is almost self-dependent ! It stores all files and entire history
a collection of files + history of changes • It is stored inside .git sub-directory • It has four kinds of objects: ◦ blob: actual file contents ◦ tree: collection of blobs along with their hierarchy ◦ tag: named reference to another object ◦ commit: revision ( snapshot ) of entire repo
is a single checkout of one version of the project. ◦ It is the directory that we work on ◦ These files are extracted from repo’s object database • Staging area ( index ) ◦ It is an area between working tree and the repo ◦ It is useful in keeping track of what will go in the next commit
.git README.md hello_world.py test_hello_world.py $ git status On branch master Initial commit Untracked files: (use "git add <file>..." to include in what will be committed) README.md hello_world.py test_hello_world.py nothing added to commit but untracked files present (use " git add" to track)
git status On branch master Initial commit Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: README.md new file: hello_world.py new file: test_hello_world.py