So you want to learn Git? Good idea. So do I. But, where to begin, right? First of all, the fact that you have an interest to learn Git and do tutorials is a wonderful thing, so pat yourself on the back. Go ahead, no one’s looking. Learning and using a version control system is extremely important, if not vital, to software development. There are many version control systems out there; the most popular ones being Subversion, Mercurial, and Git. These days, though, Git is becoming more and more popular due to the fact that it’s a distributed version control system, it’s open source and there is a very popular Web site (GitHub) that provides free online code repositories in addition to social networking features. If you are learning Ruby on Rails (RoR), you will also quickly see that the RoR community almost exclusively uses Git as their version control system.
Anyway, the Web is full of Git tutorials, but here is a list I compiled of the best ones…in other words, the ones a) you will actually learn something from and b) you won’t fall asleep doing.
GitHub offers free Webinars about not only using GitHub, but Git too–and, naturally, how the two work together. Each Webinar has one single topic. For example, there was one recently that covered how to correct mistakes in Git from the command line using commands such as commit amend, reset (mixed, soft, hard) and revert. I personally attended a Webinar taught by Tim Berglund recently and was extremely impressed. After each class, the instructor also holds Office Hours where you can ask questions not only about the material covered, during the Webinar but also basically anything you want regarding Git or GitHub (that’s right, no holds barred). These Webinars with the Office Hours are truly a gift, so take advantage of it before they decide to charge money. Incidentally, they also offer courses that you must pay for. I’m planning to save up to enroll in the Advanced Git and GitHub course after I work through all the resources below.
This Web site provides the full text of the book “Pro Git” by Scott Chacon (published by Apress). The Web site also offers some introductory videos on Git. The book is available in traditional print format too, in case you’re old school like me. If, however, you’re hooked up with an iPad or a Kindle Fire, by all means, whip out your e-reader of choice and start reading and learning about Git. The book covers the very basics (such as installing Git) to some more intermediate topics, such as hooks. On the same site you will also find a great quick Git reference guide. If you plan on becoming proficient in Git, then this is a great list of commands that you should know.
Since we are talking about iPads and Kindles, you might also want to load the pdf at this site. This pdf is not only helpful, it is also a quick read. So, for those of you who are too lazy to read an entire book or for those whose “Books to Read” list is already way too long, this pdf might be your best bet.
This is a tutorial that spans only 5 html pages and covers essential topics, including set up, initialization, cloning, committing, branching, merging and pushing. It has nice diagrams and command/output examples where appropriate. It is worth noting that this introductory tutorial is just one part of the GitHub Learning Gateway, where you can find other helpful resources (including a link to the Code School – Try Git tutorial listed below).
When you get bored of all the tutorials that just require you to read, head over to the Git Immersion tutorial, which is structured as a series of 53 mini labs. Each lab has a goal or objective (such as “Learn how to commit changes to the repository”). The steps to achieve the goal are numbered, and since the labs are brief, some of them only require one step to complete (even better!). For each step, you are given the command(s) to execute at the command line as well as the output you should see on your screen after running the command(s). I cannot stress enough the importance of getting hands-on experience when learning a new technology, and even though this is just a tutorial, it is a great way to get your feet wet and to get a feel for Git.
This tutorial is good times and aesthetically pleasing. It’s to the point–short and sweet. If anything, check it out just for its clever, fun design. The author provides a link to a great Git Cheat Sheet. Print it out and keep it by your computer when you start using Git on your first project.
I’m a big fan of Code School…they offer tutorials on a great variety of topics for Web developers, but most of them you have to pay for. However, they do offer a few free ones (SCOOOORE!), including one on Git. Their tutorials have fantastic design, so you will never be visually bored completing them. Not only that–there’s more! Their tutorials are also interactive…what better way to learn than by doing? Once you are done with the Try Git course, check out the Git Real tutorial by Code School.
Do you think all Help documents are invariably useless? Think again. GitHub has a pretty darn good Help section, if I may say so. And, while it may not technically be a tutorial, you can learn a great deal if you just read a section or two. For example, if you are planning on using Git to contribute to open source projects or to collaborate with other developers, you will certainly hear the term “pull request.” This page straight from GitHub help documentation is amazingly lucid and helpful to learn exactly what pull requests are and how to use them.
Do you learn better when there are pictures? Yeah, me too. We’re in luck! This site offers diagrams to illustrate common Git commands. The diagrams are in color too. The diagrams aren’t anything fancy, but don’t be quick to dismiss them. A lot of times pictures can better describe what’s going on than cryptic commands. If you are a visual learner, check this site out for sure. I suggest first doing some of the better tutorials listed above and then reinforcing the concepts by reviewing the diagrams.
The graphic design on this page won’t blow you away, but this tutorial is ideal for those in a rush who need to learn just enough about Git to get by.
I hope these tutorials help those of you who are interested in learning and using Git. If you find any other great resources, please share them with me and the other readers by leaving a comment.
I am adding this ebook to my list of resources even though I published this article over a month ago. I just finished reading it and will post my thoughts on it in a new post. However, since my thoughts are positive, I wanted to include it with the other great Git tutorials I have found.