Mastering Git

Git is for so much more than just never losing work. It also enables incredibly powerful workflows that, above all, encourage conversation. These conversations turn into feedback, knowledge sharing, documentation, and all sorts of wonderful things.

When you're ready to level up, thoughtbot has a wonderful course on Git: Mastering Git. Here's how to approach it:

  • I found playing the visual Learn Git Branching game to be helpful as a warm-up.

  • Do the following episodes:

    • Getting to Confident

    • Managing History

    • Undoing

    • Crafting History with Rebase

    • (skip Git Object Model for now)

    • (skip Object Model Operations for now)

    • Customizing Git

    • GitHub and Remotes

    • (skip Vim and Git for now, or forever if you are not a Vim user)

    • And most importantly, thoughtbot's Git Flow. This is what we'll use for all development beyond the very initial tiny spike to get a project off the ground.

      As soon as possible, we'll switch to this branch/PR/code-review/rebase/squash/merge workflow for all changes, no matter how small.

      A refinement to thoughtbot's Git Flow: GitHub introduced Draft Pull Requests after the Mastering Git course was written. Neat!

  • It's very important to read their PR Authoring Tips.

  • Here are some resources on what good commit messages look like (this is for the final, squashed commit; not the work-in-progress commits; don't worry about those):

After using and, more importantly, observing teammates using the flow for around a month,

  • Come back and start over from Getting to Confident. It will make more sense and sink in deeper this time.

  • Now for the fun part — do the Git Object Model and Object Model Operations episodes. After you've been using Git for a while, and then you finally peek under the hood and realize how simple it is conceptually (underneath it's terrible, terrible CLI), it's a very empowering experience.

    As an exercise, I recommend building your own super-simple git-like version control system in Ruby after doing these two episodes. Initially just make it so that all you can do is create commits, and then checkout commits. Then you can add branching, tagging, etc.

  • Glance through the resources in Learning More and dive into whatever piques your interest. There are a lot of resources/opinions now, many are more recent than the ones given there:

Last updated