Over the past few weeks I have been taking a closer look at how to use the text hosting and version control service at GitHub: part 1, part 2, part 3, and part 4. I have suggested that, in addition to being the most important hub of open source and free software on the net, its innovations also have powerful applications for any kind of collaborative authorship thanks to its distributed version control features, the process of “forking” repositories, and the social power of issuing “pull requests.”
Anyone who has read my postings that already has some background in using the git version control system or GitHub is likely to have at least a one of the following critiques of what I have written:
- I have focused entirely on GitHub and its software client, and especially the features that are easily accessed through the user interface. Anyone who takes up GitHub after these postings will eventually discover that any serious collaborative work on GitHub requires a stronger familiarity with git on the command line which is the powerful tool working behind the scenes.
- I have said almost nothing about the “tree” or the role of branches in organizing one’s work in a repository or in collaborative authorship
- I haven’t talked about the process of dealing with conflicts, which can arise when two individuals edit the same file and push their changes to the repository on GitHub
Master of the Tree
I took this approach because the vast majority of tutorials, websites, online courses, and screencasts I have seen on the web start from the opposite approach. They begin with the git tool on the command line, a relatively unfamiliar environment to many readers here at ProfHacker, although I hope that some of our posts have helped change that. They also tend to focus on examples made up of programming code, or else abstract away from specific examples entirely to focus on the broader fundamentals of the git philosophy. To do this they describe work with a generic group of texts using only the specialized vocabulary of git: we “checkout” a “branch” which becomes the “HEAD” - the most recent version of the current branch, “add” changed files to “staging,” then “commit” them, and often “push” this “origin” to a “remote” repository on GitHub.
To become a true git master is to become a master of the “tree,” which is a snapshot of all the commits and branches of a repository of files. The master of the tree is thus a master of her current world, as well as all possible worlds in the past, present, and future.
I appreciate the sentiment of this approach, a Mr. Miyagi “wax the car” and “paint the fence” path to mastery of git. However, it can turn a lot of people off at the beginning, especially if they haven’t really been fully convinced that there are some awesome Karate moves to be had at the end of day. I wanted to show in these postings that the vast majority of the time, once you begin using GitHub, you can get by with using the web interface and the GitHub local client software.
Git on the command line offers you a speedy alternative if you are familiar with it and a wealth of advanced options but eventually you will want to return to basics and master git because it will teach you the absolutely crucial tools to manage more complex collaborative projects that must deal with branching, merge conflicts, and more complex time travel in the history of your repository.
Reference, Tutorials, Books, and Screencasts
When you are ready to give the fundamentals of git a try take a look at some of these resources and get ready to do some work on the command line:
- One great place to start is a walk-through created by GitHub and Code School. It puts the command line in the browser and teaches you all the basic commands: tryGit
- A more full 53 step tutorial for git by Jim Weirich is available that covers pretty much all the main features of git and operates on a series of tutorial files: Git Immersion
- One of the biggest challenges in mastering git is not the basic series of commands, but in visualizing and mastering the tree. The Visual Git Reference by Mark Lodato helped me with this.
- The Scholar’s Lab has a nice list of resources on git as well as interesting posts on Forking, Fetching, Pushing, Pulling by Jeremy Boggs and on Teaching Git by Eric Rochester.
- Although it mixes the most common with the more obscure commands, this reference site groups some of the most important commands in git together in a useful way: Git Reference
- Once you get going you can improve your git game, as it were, with this site by Nick Quaranto, which breaks down common git tasks into levels of difficulty and also regularly adds tips: git ready
- Travis Swicegood has written a nice no-nonsense task based guidebook to all the most common tasks in git. It is a great place to turn after you have done a few tutorials and want a nice all in one reference: Pragmatic Guide to Git (Getting it from Pragmatic Bookshelf gives you a variety of DRM-free versions to download)
- Once you are ready to get on to advanced topics this book by Scott Chacon (@chacon), one of GitHub’s gurus is handy, and is completely online and can be downloaded in various formats: Pro Git
- Scott Chacon also created a series of YouTube screencasts, though the examples are from coding: GitCasts and you can see his longer lecture introduction to git here.
- There are many other screencasts out there. These days, some of the better ones will charge you but there are still some great oldies. I first learned git through this two part lecture by Bart Trojanowski: Git the Basics Tutorial
My next posting will be my last in this series directly related to GitHub and will discuss some of the limitations of using a service like GitHub for scholarly writing. I hope to then follow up by discussing some of exciting new tools and services out there for collaborative writing and versioning where I see the clear influence of GitHub innovations.
Are there other resources related to git or GitHub that you would recommend? If you have tried to learn it, what have you found most challenging?
Professortocat v2 in the Octodex collection by GitHub under terms here.