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

Git/Hub/Flow: Tidbits of Knowledge

Git/Hub/Flow: Tidbits of Knowledge

A lunch and learn talk that touches on a variety of Git, GitHub, and GitFlow topics.

-----

Version Control by Example: http://ericsink.com/vcbe/

Git from the Bottom Up: http://ftp.newartisans.com/pub/git.from.bottom.up.pdf

My Git Config: https://github.com/jacebrowning/dotfiles/blob/master/.gitconfig

Eff2cdaa8474520ed29ebc38031fab87?s=128

Jace Browning

March 06, 2015
Tweet

More Decks by Jace Browning

Other Decks in Programming

Transcript

  1. Git / Hub / Flow Tidbits of Knowledge

  2. Topics • Git • GitHub • Workflows

  3. None
  4. Version Control filesystem × time

  5. Centralized Version Control edit → merge → commit

  6. Distributed Version Control edit → commit → merge

  7. Blob Tree Commit

  8. ∑ Commits: Repository Commit ⇒ Working Tree Staging Area ⇒

    Commit Branch / Tag ⇢ Commit
  9. None
  10. “Don’t delete that branch; I might need it later.”

  11. Commit Message This commit will... “Fix bug #42”

  12. Merge Commit Message “Merge branch ‘that-branch’ into this-branch”

  13. Extended Commit Messages “<further explanation, references, etc.>”

  14. $ git checkout -b <branch name> $ git checkout <branch

    name> $ git status $ git diff $ git add <filename> $ git commit $ git merge <branch name>
  15. $ git fetch $ git push

  16. None
  17. “oops.. forget to remove this”

  18. None
  19. None
  20. “Fix bad merge”

  21. None
  22. “Fix compile warning” “Fix broken test” “Fix style warning”

  23. $ git pull fetch + merge

  24. “Merge branch ‘master’ of github.com:Adonit/name”

  25. $ git rebase replay commits in a different location

  26. None
  27. None
  28. None
  29. None
  30. “Where did that code go?” force pushing alters history

  31. $ git reset --hard reset working tree, index, HEAD

  32. $ git reset --soft reset HEAD

  33. $ git cherry-pick add commit from another branch

  34. Pairing is Sharing

  35. None
  36. Pull Requests a conversation: ‘branch’ into ‘base’

  37. When to PR? it’s only the start of the discussion

  38. Comments and Notifications

  39. Automatic Merging pull/42 vs. pull/42/merge

  40. GitHub Issues lightweight tracker, connects to PRs

  41. Closing Issues “Fixes #42”

  42. None
  43. Branching parallel development, multiple releases

  44. GitFlow release-oriented branching model

  45. develop feature/<topic-name> release/<vX.Y.Z> hotfix/<vX.Y.Z> master

  46. None
  47. qa bug/… tweak/… plumbing/… sewer/… proto/...

  48. GitHub Flow deploy-oriented branching model

  49. master <topic-name>

  50. None
  51. Further Reading Version Control by Example http://ericsink.com/vcbe/ Git from the

    Bottom Up http://ftp.newartisans.com/pub/git.from.bottom.up.pdf My Git Config https://github.com/jacebrowning/dotfiles/blob/master/.gitconfig