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

Git Basics

Git Basics

0b2600a627d0af06ca6bbf9abe4067af?s=128

James Hughes

June 22, 2012
Tweet

More Decks by James Hughes

Other Decks in Programming

Transcript

  1. Git Basics

  2. version control noun Computing the task of keeping a software

    system consisting of many versions and configurations well organised.
  3. Centralised (e.g. Subversion)

  4. 1 source of truth 1 point of failure

  5. Distributed (e.g. Git, Mercurial)

  6. No 1 source of truth No 1 point of failure

  7. Commands (for day-to-day activities)

  8. init clone add commit remote push stash revert log branch

    checkout merge
  9. Staging (the fundamental git concept)

  10. working directory staging area/index repository add commit

  11. Helping Hands (log, diff & status)

  12. log diff status Show commit logs Show changes between commits

    Show the working tree status
  13. .gitignore (excluding files you don’t need)

  14. .gitignore bin/ obj/ *.tmp

  15. Workflows (super simple, happy path git usage)

  16. Create or copy a repo Committing code Pulling code Pushing

    code Feature branches Backing out changes
  17. init/clone add commit push Super Simple Git Workflow For the

    lone wolf
  18. Super Simple Team Workflow For the hyper agile team init/clone

    add/commit pull push
  19. stash push add commit init/clone pull stash apply Team Workflow

    Pulling mid-commit
  20. Feature Branches Short Lived, Isolated Sandboxes add/commit branch push checkout

    merge checkout init/clone
  21. Undoing Changes (checkout, reset & revert)

  22. checkout <file> reset HEAD <file> revert HEAD Revert uncommitted changes

    Revert staged changes Revert committed changes
  23. /Git Basics