Upgrade to Pro — share decks privately, control downloads, hide ads and more …

git intro by mkilling

git intro by mkilling

Git intro presented by @mkilling at git aficionados meetup.

Kai Howelmeyer

December 13, 2013
Tweet

More Decks by Kai Howelmeyer

Other Decks in Programming

Transcript

  1. If you change anything about an object, it’s not the

    same object anymore.! 
 It becomes a new object.! SHA1! a3768903ca03f7cccb3c6b6f474f88f8e9a3bb5b
  2. a5d743   initial msg: commit 2 msg: Feature A msg:

    master Feature B msg: branch1 HEAD $ git checkout branch1 $ git checkout a5d743 You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.  
  3. commit 2 msg: Feature A msg: Feature B msg: branch_b

    merge branch_b msg: master HEAD $ git merge branch_b
  4. initial msg: commit 2 msg: commit 3 msg: master HEAD

    $ git reset --hard HEAD^ a3768903 ca03f7cc cb3c6b6d
  5. alice commit1 commit2 commit a master bob commit1 commit2 commit

    a master origin commit1 commit2 commit a master
  6. alice commit1 commit2 commit a master commit b bob commit1

    commit2 commit a master commit1 commit2 commit a master alice$ git push origin master commit b origin
  7. alice commit1 commit2 commit a master commit b bob commit1

    commit2 commit a master origin commit1 commit2 commit a master commit b commit b bob$ git fetch origin/master
  8. alice commit1 commit2 commit a master commit b bob commit1

    commit2 commit a master commit1 commit2 commit a master commit b commit b origin/master bob$ git fetch bob$ git merge origin/master
  9. alice commit1 commit2 commit a master bob commit1 commit2 commit

    a master origin commit1 commit2 commit a master Feature B Feature B Feature A Feature B origin/master merge origin/master Feature A merge origin/master fetch merge origin/master push 6c699cb..04872e1 master -> master
  10. John  McDonnell:  Git  for  computer  scienEsts    hFp://nyuccl.org/pages/GitTutorial/    

    resources! ScoF  Chacon:  Pro  Git          hFp://www.git-­‐scm.com/book   LearnGitBranching          hFp://pcoFle.github.io/learnGitBranching/  
  11. .gitignore! # Untracked files: # (use "git add <file>..." to

    include in what will be committed) # # .DS_Store # config/database.yml # log/