Hacker News new | past | comments | ask | show | jobs | submit login
Git Tutorials for Beginners (sixrevisions.com)
286 points by DanielRibeiro on June 8, 2011 | hide | past | web | favorite | 28 comments

A few great resources are missing from that big list at the bottom:

Git internals PDF (Scott Chacon) http://peepcode.com/products/git-internals-pdf

"Getting Git" screencast (Scott Chacon) http://blip.tv/scott-chacon/git-talk-4113729

Interactive Git cheatsheet (Andrew Peterson, NDP Software) http://www.ndpsoftware.com/git-cheatsheet.html

The best resource for understanding git (or probably bzr/Mercurial) IMO is definitely "The Git Parable" [1]. It takes you through the steps of what you'd do to create a DVCS. This teaches you the concepts, without worrying about the commandline.

Once you understand git, the man pages, docs at kernel.org and cheatsheets are a much easier read. My go-to cheatsheet is now [2], which is actually more of a visualization of commands to use to move between git's different areas.

I must admit, I still need to Google every now and then for things that are counterintuative in git (e.g. removing a submodule) and normally end up on StackOverflow.

[1] http://tom.preston-werner.com/2009/05/19/the-git-parable.htm...

[2] http://ndpsoftware.com/git-cheatsheet.html

I loved the "Git Internals" PDF by Scott Chacon (github) probably not targeted for "Beginners" but a good read nonetheless.

I learned a lot from the Getting Git screencast when I learned how to use it, +1 from me

To me the single best resource for really building a mental model of git (and not just learning how to do a handful of 'cookbook' actions) is the git user manual: http://www.kernel.org/pub/software/scm/git/docs/user-manual....

Once I read that, I never had to look at any git intro tutorials again.

What really helped me understand Git was this 2-part tutorial that uses Gitk to show how your commits and merges work.

Part 1 - http://lostechies.com/joshuaflanagan/2010/09/03/use-gitk-to-...

Part 2 - http://lostechies.com/joshuaflanagan/2010/09/03/use-gitk-to-...

I'm surprised how few tutorials mention Gitk.

Beyond git tutorials, I recommend easygit (eg). It's a "training wheels" wrapper for git and available in Ubuntu's Package Manager.


easygit is git with sane defaults and better error messages. It uses real git commands, so you don't need to unlearn anything when graduating to git. It has extra sanity checks (like checking for unstaged changes when committing). The help messages are more verbose and use more consistent terminology than git's man pages. For example, easygit always uses the term "staged" instead of "index/staged/add/hard/soft/mixed/cached/HEAD/etc." And `eg revert` behaves the same as Perforce, SVN, and Mercurial revert.

The overloading of "checkout" to mean revert a file as well as "switch to a different branch" is for me one of the most confusing git design choices.

1. You're right, it's confusing when coming from a Subversion background. 2. It makes sense when you realize that 'switching to a different branch' and 'reverting a file' are both operations that make your working copy (partly) match a branch, be it a different branch or just your current HEAD. Git is full of stuff like that. Once you get the fundamentals down it all starts to make sense.

It's a poor UI even for people like me who have never used SVN. Understanding how something works after having learned it is not a sign of a good UI, a good UI facilitates easy learning by having commands do the thing you'd expect them to do, so far as that is possible.

The fact that file checkouts and branch creation shares underlying mechanics have nothing to do with the UI, it'd make a lot more sense to create new branches with for instance the git branch command, and checkout files with the git checkout command.

Having said that, I don't think the git UI is horrible at all. I found learning the basics of git rather easy, that doesn't mean the UI can't be improved on further, though.

> 'switching to a different branch' and 'reverting a file' are both operations that make your working copy (partly) match a branch

git revert is the "undo committed change" command.

git reset is the "discard uncommitted change" command (what is called "revert" by Subversion, Mercurial, Perforce, Bazaar, Darcs, Fossil, and SVK).

'Pro Git' is a fine resource, but it is pretty intense for beginners. When I started, I just wanted to check something in. I've found the 'Pragmatic Guide to Git' to be the best reference for getting things done. It has a fantastic organization that sends you exactly where you need to go and lots of examples to perform the most common tasks.

A similar list for Mercurial, please?

http://mercurial.selenic.com/ ... intro, man, howto, wiki http://devcheatsheet.com/tag/mercurail/ ... some visuals

Has anyone read Apress's Pro Git by Scott Chacon? Do you recommend it?

I absolutely recommend it! It's great. Read it online from the link provided by the comment below or buy the book, what ever suits you best.

I also recommend to heavily use gitk while learning, just use it to see what happens after you do something in your test repositories. It's very enlightening.

You mean the one available for free here: http://progit.org/ ?

Best Git book by far IMHO

"di-git-ally managing love letters" http://shakthimaan.com/downloads/glv/presentations/di-git-al... . I started using git reading it.

http://www.gitguys.com is a new resource for people wanting to learn git. It has lots of diagrams that step through changes in the index, working directory, git object store, etc.

I've been working through git immersion the past few days and it's definitely helped a lot. Short exercises to teach basic things.

Why would anyone want 10 tutorials?

To find the one that helps them the most? Not everyone learns in the same way, and not everyone teaches in the same way. The more choices you have, the more likely you are to hit on the one that lets you really grok something.

Since there is no bookmark feature, "Tag"


Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact