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

Laura Erskine

Laura Erskine

Git (a Software Control Management System) - focus on branching and detached heads (aka play area for testing)

Avatar for Laura Erskine

Laura Erskine

July 26, 2013

Other Decks in Programming

Transcript

  1. A bit about Git and only Git ( with a

    focus on branching, and detached heads!) Who am I? Laura Erskine How to find me: linkedin.com/lauraerskine
  2. Before diving in, first some assumptions and agreements to be

    made: * You know a little bit about Git and what it is * You are on a single person project * and ….
  3. … you are on a desert island without internet connection

    and you have never heard of the word 'Git Hub'
  4. First up – feature branching • Set up your project

    for Rails • Set up Git on your project • Get to work on your project! You might do a series of more commits along the way! • At some point --- you realize you have something fairly solid, or you have something functional that works, or end of a chapter in tutorial!
  5. – Git branch #to make sure you are on master

    (in response it with have * next to master) – git commit -m “Last Known Good - LKG” – git branch featureA #creates the branch – git checkout featureA #makes branch working one – [ Do some work on your new feature!] – git add . – git commit -m “add feature A”
  6. You have worked on featureA, all commited, and now you

    are ready to get it into your master ( aka main branch ) – git checkout master #switch back to master – git merge featureA # merge feature changes into master – git branch -d featureA # deletes the featureA branch
  7. How to test out an older commit! – git log

    (to get the SHA-1 id), aka the play version you want to see how it worked) – git [SHA-1 id] Oh nooo.... a nasty-looking message appears...
  8. A So you can now play... How to NOT play

    anymore: - git checkout master How do you know if you are playing with detached head or back with the master? – git branch
  9. Summary Take away – If you are not branching even

    on your own machine – start now! And you can play with Detached Heads! • Cheat sheet: https://na1.salesforce.com/help/doc/en/salesfo rce_git_developer_cheatsheet.pdf • Google exactly this: Git Docs (Bonus tip from Lauren Hughs – you can find her on LinkedIn!) • or... Online version of the command line help: – https://www.kernel.org/pub/software/scm/git/docs/user-manual.html