What’s the best git tutorial?
15 points by Student
15 points by Student
I’ve volunteered to teach my colleagues about git - at least one of whom seems to know nothing of it.
Obviously, I don’t want to start from scratch. Which tutorials have helped you, or helped you get people up to speed?
We’re using gitlab, I don’t need to cover true distributed workflows, just forge-oriented git usage to collaborate with colleagues.
https://jwiegley.github.io/git-from-the-bottom-up/ is what helped me.
When I teach git, I usually suggesting focusing on state (git status
, git log
, git reflog
), and googling the rest.
Whenever I teach git I take a whiteboard and redo something like this schema live while explaining every state and transition.
https://user-images.githubusercontent.com/14274827/91470661-9d5a8780-e8b2-11ea-9ccb-0d813d2e35d1.png
It gives a pretty clear mental model and makes inconsistencies very glaring (and thus easy to remember)
https://learngitbranching.js.org is by far the best. It is a game which shows you the actual graph so you can do transformations directly on it and gives you many byte sized exercises. You can do everything in 2 hours and be in the top 90% of git users.
The one I found most useful was git for computer scientists.
I concur.
This guide shows visually how Git rearranges the graph of commits for the major operations.
Once you’ve played with Git, this resource allows to understand what Git does, and that allows to use commands efficiently to rebase or cherry-pick without struggling.
This is the resource I recommend the most to newcomers to Git, not to use the first day, but after one week.
It’s especially important for people working on team projects, like open-source projects, to cope with main branch rebase.
I like the sections of the git book. The diagrams at the very least make for a good tutorial and it makes for an excellent study guide.
At least that’s how I learned.
Personally, I found the chapter on reset and checkout really helpful for just explaining the git model in general because you have to understand the git model to understand those two commands (imo). Which means that particular chapter was very enlightening in terms of understanding git in general for me.
I’m not sure how your colleagues would react, but these “Git Commands Explained with Cats” doodles have always stuck with me: https://girliemac.com/blog/2017/12/26/git-purr/
Theres some excellent resources here, but Beej is pretty famous for his network programming series and recently released his guide for Git.
He says its about 10% of Git, but 90% of what you need. Which is wild.
Please keep in mind that I’m only human and there is a very, very high probability that there are errors in this guide.
The guide seems generally quite accurate and would likely beat any contemporary non-human-written guides :)
I did this once and I was amazed at how bad all of the git learning materials out there are.
The one thing that really helped me is this tutorial by Atlassian (!!!) which does a really good job explaining everything using (well-designed, friendly) diagrams.
https://www.atlassian.com/git/tutorials/merging-vs-rebasing
Not sure if it’s still the best thing out there, but it was a bunch of years ago.
There are some very very good resources mentioned already. At the risk of repeating, here is one more that really helped me see “under the hood”, and consequently helped me understand git better: https://articles.foletta.org/post/git-under-the-hood/
I taught a class about this (and other things) at two universities and it seems to help students get up to speed on Git, including its object model: https://bernsteinbear.com/isdt/