Useful Git patterns for real life

much of this originates as live workshop materials; we are gradually creating nice prose versions

Git patterns that come up frequently in real work:

  • Commit early and often. Push less often. The Repeated Amend.
  • Help, my push was rejected!
  • Integrating remote and local work. Probably so you can push again.
  • Burn it all down.
  • Time travel:
    • “I just need to see the past”. Browse and search on GitHub.
    • “I need to visit the past”. Create a checkout a branch.
    • “I want to return to the past”. git revert, git reset
    • “I had a great cookie last October”. git cherry pick, git checkout REF -- path

Play well with others: