branching, committing, merging and rebasing, managing history
Version control helps you track the changes you make to the programs you write. It also allows you to work with others on the same codebase.
Although there are different version control systems out there, the resources provided here focus on Git.
If you haven’t installed and set up Git, then do that first. Check out these free video lectures to get a brief overview of version control and Git. The lecture titled “Get Going with Git” will show you how to get up and running with Git. For additional guidance installing and setting up Git, check out chapter 1 in the free electronic book, Pro Git by Scott Chacon and Ben Straub.
Now for some resources to get familiar and confident with Git’s commands and workflows.
If you’re new to Git, then follow this strategy: learn just enough then apply what you learn right away. Consider Rick Umali’s book, Learn Git in a Month of Lunches, which is geared toward beginners. Umali introduces a concept, then asks you to try it out yourself—and you should! Make your learning active. There are also labs at the end of each chapter that are worth doing.
If you’ve got some experience with Git, then you can still use Umali’s book. But use the apply first, study second approach: try the lab first, then refer to the content within the chapter if you get stuck. The idea is to find out what you don’t know, then focus on that. This is the best strategy I’ve found for learning and retaining information. For practice with branching in particular, check out this online tool: Learn Git Branching.
"The best way to graduate from beginner is to get in way over your head. Nothing makes you better faster."
If you're more of an intermediate-level Git user, then you'll find Mastering Git by thoughtbot useful. This free course is organized by topic, like undoing and managing history. And each topic contains a video lecture and notes. The material is clear and targeted, which are reasons why I like it so much. But please note that this resource isn’t intended for those who are completely new to Git. It’s more of an intermediate-level course, and best for those who are familiar with Git and its workflows.
Similar to learning shell commands, it’s important to identify ways to drill and re-drill Git commands—no matter the level. In other words, don’t watch an entire lecture from start to finish and say to yourself, “oh, yeah. That makes sense. I’ll remember it.” Instead, consider these two learning methods.
First, create an Anki flashcard deck. Write cards that prompt you to run a command. For example:
Then, go to your terminal and run the command. Second, create a cheat sheet of commands, and put the cheat sheet in a noticeable spot so you see it and use it in your daily work. Print it out and hang it on your wall by your monitor. That way, you’re constantly reminded to use them.
Tip: The quicker you get to the doing, the better the learning. Make your learning active.
If you run into a roadblock, then reference the free electronic book, Pro Git by Scott Chacon and Ben Straub.