Git is powerful, and Github is its killer app. I use them for all my projects. That being said,
Git is more difficult than it ought to be, but until now I couldn’t put my finger on why
I was doing some mundane Linux command line work when I had my flash of insight. I’ve been using Linux for years, but I almost made a typical newbie mistake with the
mv command. I wanted to rename a file:
mv /path/to/old_name new_name
Urp! I stopped, because this would not have just renamed the file, but moved it into my current directory as well. And then I recalled the typical
mv tutorials which usually explain how the unix filesystem works, and how with that understanding, mv’s behavior makes sense.
In other words, mv combines two conceptual functions into one thing, simply because that’s the underlying implementation.
And I realized that this kind of “implementation leakage” occurs with many git commands. The non plus ultra evidence is the excellent post, Git Reset Demystified by Scott Chacon. It’s about git’s equivalent to svn revert — a very important function, undoing your changes. But even though Scott is very knowledgable about git and even authored the book, Pro Git ♢, he
…never strongly understood the command beyond the handful of specific use cases that I needed it for. I knew what the command did, but not really how it was designed to work.
It’s no wonder that ordinary git users don’t fully grasp these commands. In a final unintentional confirmation of my theory about git’s problems, Scott presents this 6×4 table as a learning aide:
Another example is the well written O’Reilly book Version Control with Git ♢. By necessity, It teaches the internal implementation of git before explaining how to fully use it. Or, as David Eisinger says,
…until you wrap your head around its internal model, it’s easy to wind up in a jumble of merge commits or worse.
Fixing git: two ideas
- The aptitude route. (Specifically, the command line use.) Originally, one needed to remember to use apt-get install but switch to apt-cache search to look up packages, due to implementation details. Now, however, both functions are available via one high level command line interface, aptitude. Legit is the only one I’ve found so far and looks pretty good. I’ve begun writing up my own ideas about what a front-end would have as well.
- Git command aliases. Git supports the creation of new commands via its alias feature. This might not be a bad route, if it’s flexible enough. LOLA’s a great example.