Ask HN: What's the best way to learn Git for a version control (mostly) newbie?

14 points by JohnTHaller ↗ HN
I find myself laid up with a broken ankle/leg and I've been meaning to learn Git for a while, so I figured this would be the best opportunity. I last used version control back with Visual SourceSafe (I know, I know) in the late 90s while I was working corporate. Now, I hack on PortableApps.com which uses a combination of Hg, Git and SVN for various sub-projects, though my stuff often only gets dumped in once per release. I'd like to get them all better organized and standardize on one system, and it looks like Git will be it (possibly at Github).

On my end, I know enough to re-read a manual and poke a button on the various SCMs here and there to get some code out and maybe get a change in. But overall, assume I'm starting from scratch. I need to learn from the basics through the theory (branches and merging and collisions, oh my) through some more advanced bits. I'm more comfortable with a GUI but can use the command line in a pinch. And I'll be using it in Windows exclusively for now. I may branch out to Linux later, but all my work is on Windows apps at present.

I've done the usual Google searches and know about things like try.github.io, codeschool, etc, but figured that some of the more experienced folks here... maybe even some of the github folks here... could point me in the best direction.

Thanks in advance!

8 comments

[ 2.8 ms ] story [ 32.5 ms ] thread
A good place to start is by reading through the Pro Git book, available for free at http://git-scm.com/book. Try out the commands as you read about them in a small sandbox environment you set up for yourself. Even if you don't learn everything at once, you will have a great reference to go back to when needed.
Check out Git tutorials from Atlassian, the company behind BitBucket:

https://www.atlassian.com/git/

I suggest reading it from cover-to-cover as they go from basic stuff to more advanced topics.

Atlassian is also the owner of SourceTree, which as a visual gui, I found really helped in learning some of the flow of using GIT.
How I am learning Git on Windows:

I have a free account on Github and use the Windows app. The interface has a Metro look, but it's not a Metro app. The downside of Github is that all free account repositories on Github are public, and I have a use case, coursework for Coursera classes, that make public repositories inappropriate.

For that I have a free account on Bitbucket because it allows private repositories. I access that using Atlassian's free version of SourceTree. What I like about SourceTree is that it exposes more of the guts of version control. If command line Git is C, it's Java, and the Github app is...well, it's an app.

The mention of the command line is not accidental. Once I start wanting to do something a little advanced, the step by step descriptions for implementation will invariably use the command line because at it's core Git is not an app; it is a system with a command language, and the command language maps directly onto Gits underlying concepts in a specific way versus the generic language of click here, select that, type this, click there...etc. of app usage.

As a twenty odd year user of Windows, it feels very unnatural to say this, but learning the command line is something to be embraced.

Lastly, my thanks to Eric Sink for the free! [hard!] copy of his book Version Control by Example which he graciously provided as an "Offer HN:" a couple of years ago. It provides consistent examples which cover the general issues across different types of version control systems. When I finally got around to using version control, I reread it more thoroughly than when I was merely interested in the topic.

http://www.amazon.com/Version-Control-Example-Eric-Sink/dp/0...

Lynda.com has a good videotutorial on all Git basics.