Pragmatic Version Control Using Git (book review)
The geek world is full of exciting drama and conflict if you know where to look. We're going to take a look at "Pragmatic Version Control Using Git" by Travis Swicegood, which I believe is the first printed Git book by a major publisher. But before we look at the book, let's take a quick stroll down memory lane because the birth of Git is a fascinating story, all full of thunder and drama.
Git is a distributed version control system/source code manager invented by Linus Torvalds, and was born of Shakespearean-worthy conflict and strife. Just like Linux, he named it after himself, though with a bit more tongue-in-cheek. If you're not familiar with British slang, a git is an "unpleasant or contemptible person". For example, "That Linus is a stupid git." Of course he isn't really a git, or at least not stupid, but that's just Linus.
Git was inspired in part by Larry McVoy's BitKeeper, which was considered by Linus to be the most advanced SCM available at the time. Mr. McVoy had the services of the best programmers in the world using and improving BitKeeper, and they got free use of BitKeeper, but it was an uneasy alliance. Using BitKeeper for kernel development was controversial because it is a closed, proprietary product. Linus and some other key developers liked it, but Alan Cox, Andrew Tridgell, and other developers didn't like the idea of using a proprietary VCS for Linux kernel development, and refused to use it. Mr. McVoy exacerbated the situation by continually changing the terms of the BitKeeper license and imposing ever-more stringent restrictions, such as not implementing any of the BitKeeper ideas or concepts in other products.
Tridge ignited a major firestorm by writing a Free client for BitKeeper, which would have allowed kernel developers who did not want to use the proprietary BitKeeper clients to have equal access. Shortly after that Mr. McVoy revoked all of the "free use" licenses and required anyone who wanted to continue to use BitKeeper to switch to the commercial version. In addition he refused to allow any OSDL (Open Source Development Lab) employees, which included Linus Torvalds, to use BitKeeper at all.
Whew! That's quite a soap opera, and you should keep it handy the next time somebody has the delusion to say to your face "Software developers are logical and analytical." Ha! They wish. They're really flaming pits of partisan passion. Check out the links in the Resources section for more information; it's a good instructive lesson for anyone who wonders "Hmm, why can't closed proprietary code and Free/Open Source software just get along?"
Why Use Git?
If you are a complete Git newb, start at the beginning and work your way through the book in chapter order. If you don't you'll miss important steps and get all confused, which is what I did. Take it in order and take it slow and you'll be fine. Remember what our grannies used to tell us: "More haste makes less speed."
Chapter 1 launches right into the "30,000 foot view" of Git, what it can do, and what you should use it for. This is invaluable information that is too-often omitted from technical documentation.
Chapter 2 covers installation, basic configuration, and basic usage.
Chapter 3, "Creating Your First Project" is where the fun begins and you actually start using Git. This is like a quickstart that runs you through all of the fundamental steps. If you're thick like me, run through the steps in this chapter a couple-three times from scratch, and then the rest of the book goes a lot easier.
There is a key concept introduced in Chapter 3: staging. Most Git documentation, such as the Git Community Book use the term "index" to mean "staging area." "Index" is the common term in the Git docs I have studied, and it is a chronic source of confusion. I think "staging area" is more accurate and helpful.
Part II, "Everyday Git", is well-named, because it teaches all of the functions you're going to use the most along with the whys and wherefores of doing things in certain ways. Commits, branching, tagging, remote repositories, organization, history, making changes, finding things and looking at status-- it's all here.
The remaining chapters cover tasks like migrating from CVS and Subversion, creating a public Git repository, and various tools and accessories for Git.
I give this book a thumbs-up, because even though there is the free Git Community Book, Wiki, and other free documentation, "Pragmatic Version Control Using Git" is the best-organized and most thorough. I'm not enough of a Git guru to know what was left out, if anything; I do know that I was up and running quickly, and acquired a good understanding of the whys as well as the hows.