Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Getting started with
GIT
Content
● Why do we need git?
● VCS
● CVCS,DVCS
● History of git
● 3 states/areas of git
● How git is so fast
● How git st...
Why do we need Git?
C++
Why do we need Git?
Node.js
● I needed a VCS (Version control system)
Why do we need Git?
Node.js
V 1.1
Node.js
V 1.2
Node.js
V 1.3
Why do we need Git?
Git is a VCS.
Why do we need Git?
I just attended
a mooc on
programming for
noobs
Node.js
Why do we need Git?
● Problem was to keep the code in sync at some
common place.
● We needed a Centralized version control...
DVCS vs CVCS
● CVCS
● Users have the latest snapshot
of code
● There is only one remote
● DVCS
● Users have the whole hist...
Bit about history
● Creator of git ?
● Till 2002 linux code and patches
were passed through archives.
● Then they started ...
3 areas of git
● Git directory
– Committed code
● Working area
– Uncompressed latest
snapshot from git
directory
● Staging...
How git is so fast
● Snapshots not
pointers
How git stores commits?
Commit = pointer to the snapshot of staged content +
author, date, other meta data + parent commit...
Git branches
● Represents an independent line of development
● A brand new set of working,staging and git directory.
● Cre...
Git configs
● Lets you get and set configuration variables that
control all aspects of how Git looks and operates.
● Types...
Basic commands
● Clone
– Allows you to pull the git directory from remote to your machine.
● Status
● Add
– Add files to s...
And some more...
● ignore
– gitkeep
● blame
● stash
● diff
● git rm
● git log and gitk
● git checkout
● git grep
● checkou...
Contributing on github
● Fork
● Commits in my remote
● Multiple remotes use case
● Pull request
Upcoming SlideShare
Loading in …5
×

Git.odp 0

181 views

Published on

Slide for the talk on "getting started with git" I gave at Paytm.

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Git.odp 0

  1. 1. Getting started with GIT
  2. 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
  3. 3. Why do we need Git? C++
  4. 4. Why do we need Git? Node.js
  5. 5. ● I needed a VCS (Version control system)
  6. 6. Why do we need Git? Node.js V 1.1 Node.js V 1.2 Node.js V 1.3
  7. 7. Why do we need Git? Git is a VCS.
  8. 8. Why do we need Git? I just attended a mooc on programming for noobs Node.js
  9. 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. 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. 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. 12. 3 areas of git ● Git directory – Committed code ● Working area – Uncompressed latest snapshot from git directory ● Staging area
  13. 13. How git is so fast ● Snapshots not pointers
  14. 14. How git stores commits? Commit = pointer to the snapshot of staged content + author, date, other meta data + parent commit pointer(s) (=<0).
  15. 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. 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. 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. 18. And some more... ● ignore – gitkeep ● blame ● stash ● diff ● git rm ● git log and gitk ● git checkout ● git grep ● checkout vs reset
  19. 19. Contributing on github ● Fork ● Commits in my remote ● Multiple remotes use case ● Pull request

×