2. Content
â Why do we need git?
â VCS
â CVCS,DVCS
â History of git
â 3 states/areas of git
â How git is so fast
â How git stores commits?
â Git branches, merge vs re-base
â Configs in git
â Local
â Global
â System
â Git basic commands clone/init,add,commit,pull,push
â Git ignore,blame,stash,squash,diff
â Contributing to github
8. Why do we need Git?
I just attended
a mooc on
programming for
noobs
Node.js
9. Why do we need Git?
â Problem was to keep the code in sync at some
common place.
â We needed a Centralized version control system
(CVCS) or a Distributed version control system
(DVCS)
10. DVCS vs CVCS
â CVCS
â Users have the latest snapshot
of code
â There is only one remote
â DVCS
â Users have the whole history of
code
â There can be multiple remotes
11. Bit about history
â Creator of git ?
â Till 2002 linux code and patches
were passed through archives.
â Then they started using a DVCS
called bitkeeper.
â In 2005 relationship bw bitkeeper
and linux community broke.
â On a sunny Sunday of April, linus
laid the foundation of git.
12. 3 areas of git
â Git directory
â Committed code
â Working area
â Uncompressed latest
snapshot from git
directory
â Staging area
14. How git stores commits?
Commit = pointer to the snapshot of staged content +
author, date, other meta data + parent commit
pointer(s) (=<0).
15. Git branches
â Represents an independent line of development
â A brand new set of working,staging and git directory.
â Creating new branch
â Merging branches
â Rebase
â Merge vs Rebase
â Diff in branches
16. Git configs
â Lets you get and set configuration variables that
control all aspects of how Git looks and operates.
â Types of configs
â Local config (.git/config)
â Global config (~/.gitconfig)
â System config (/etc/gitconfig file)
â git config -l âsystem/global/local
â git config --local user.email
17. Basic commands
â Clone
â Allows you to pull the git directory from remote to your machine.
â Status
â Add
â Add files to staging area
â Unstaging staged files (reset and rm â-cached)
â Commit
â Pull
â Pull vs fetch
â Push
18. And some more...
â ignore
â gitkeep
â blame
â stash
â diff
â git rm
â git log and gitk
â git checkout
â git grep
â checkout vs reset