GitThe stupid content tracker basics.                            Piotr Benetkiewicz                            AIS.PL
Distributed● entire(fully functional) repository on your  disk● remote repositories sync● git init● git clone xxx://remote...
Configuration●   ~/.gitconfig, .git/ in local repo●   various git commands●   .gitignore in local repo root (regexps)●   e...
(very) basic workflow●   git clone xxx://remote.repo/ (one time)●   git pull●   hack, hack, hack●   git status●   git add ...
git add● index = staging = "the next patch"● not all modified/added files have to be  included in the next commit● untrack...
git commit                  changed1.cs   changed2.cs          SHA1    changed3.cs   changed4.cs                  diff    ...
HEAD, master, branch_name...Pointers... HEAD~2 <- HEAD^ <- HEAD                               Image by http://marklodato.g...
undochange foo - git checkout foogit add foo - git reset foogit commit foo - git reset --[hard/soft] HEAD^typo, forgot sth...
git branch● light● quick● branch per featuregit   branch branch_name (create)git   checkout branch_name (switch)git   chec...
git mergegit merge feature_branchcreate new (one) commit containing allchanges (one or more commits) from thebranch being ...
conflict● merged files end up in staging area● git explicitly says which files contain  unresolved conflicts after merge● ...
rebasegit rebase master"play" my commit history on top of the givenbranch                      orchange my point of branch...
rebase (cont.)
Upcoming SlideShare
Loading in...5
×

Introduction to GIT

558

Published on

Basic of Git for absolute beginners.

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
558
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
12
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Introduction to GIT

  1. 1. GitThe stupid content tracker basics. Piotr Benetkiewicz AIS.PL
  2. 2. Distributed● entire(fully functional) repository on your disk● remote repositories sync● git init● git clone xxx://remote.repo/ ○ xxx: ssh, http, filesystem... ○ common: ssh -> keys authentication● git clone http://piotr.vpn.ais.pl/git/[login].git
  3. 3. Configuration● ~/.gitconfig, .git/ in local repo● various git commands● .gitignore in local repo root (regexps)● exclude file in .git/info/ (not versioned)
  4. 4. (very) basic workflow● git clone xxx://remote.repo/ (one time)● git pull● hack, hack, hack● git status● git add file_that_i_hacked.cs● git commit -m "add feature"● git log● git push origin master
  5. 5. git add● index = staging = "the next patch"● not all modified/added files have to be included in the next commit● untracked files appear in all branches● git add .● git commit -a
  6. 6. git commit changed1.cs changed2.cs SHA1 changed3.cs changed4.cs diff diff ef0ab9 571d59 9c4bb5 Time
  7. 7. HEAD, master, branch_name...Pointers... HEAD~2 <- HEAD^ <- HEAD Image by http://marklodato.github.com
  8. 8. undochange foo - git checkout foogit add foo - git reset foogit commit foo - git reset --[hard/soft] HEAD^typo, forgot sth? - git commit --amend
  9. 9. git branch● light● quick● branch per featuregit branch branch_name (create)git checkout branch_name (switch)git checkout -b branch_name (create and switch)git push origin branch (push local branch to remote)git branch lbranch origin/rbranch (map remote to local)
  10. 10. git mergegit merge feature_branchcreate new (one) commit containing allchanges (one or more commits) from thebranch being merged
  11. 11. conflict● merged files end up in staging area● git explicitly says which files contain unresolved conflicts after merge● user manually resolves conflicts● user adds resolved files to staging
  12. 12. rebasegit rebase master"play" my commit history on top of the givenbranch orchange my point of branching
  13. 13. rebase (cont.)
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×