r/git • u/ScallionOld8766 • Oct 18 '26
Pro Git vs. Head First Git
I'm a CS student interested in backend development, and I'm learning Git for the first time.
I'm choosing between Pro Git and Head First Git. I've read Head First Java and Head First Design Patterns before, and I really liked their teaching style.
Which book would you recommend for building a solid Git foundation for professional work? Is Head First Git enough, or is Pro Git the better choice?
31
Upvotes
39
u/Specific-Yak-6450 Oct 18 '26
props to you for still reading books! it's a rare quality to find in students nowadays
18
u/sankyo Oct 18 '26
I will throw in this: pro git is very dry. MIT has this “missing semester” series and one is git basics https://missing.csail.mit.edu/2026/version-control/
14
u/samgranieri Oct 18 '26
I highly recommend reading the books on this. I have read them, but I think one of them is written by Scott Chacon who used to work for GitHub.
I’ve been using git for 19 years and I’ve got some advice for you
Once you’ve mastered the basics, I think you should spend time learning about the reflog, rewriting history, and rebasing.
What’s the reflog? It’s an immutable audit trail of anything you did in the repo. If you screwed up some merging or rebasing or whatever, just use the reflog to the commit from like, uh, the last time you felt good about your code, like this morning, and do a hard reset.
Rewriting history?
Ok, sometimes I’ll have a pile of commits with like commit messages like “update”, “update”, “hope this works”, “please fucking work” and the like.
Now, that’s only on my local tree. But let’s say I want to push this up for review at work. It’s not professional to have profanity in a commit message, so I’d rebase the last four commits and squash them together into one commit and reword the commit message to it looks like “[JIRA-123] add GenServer tests for mTLS client” or something like that.
Rebasing? What’s that?
Let’s say you’re tracking a remote branch that’s moving fast. You can pull your changes down on the main branch and merge your changes into it, or, you can place your commits ahead of your desired remote branch. Sometimes you get merge conflicts but that’s another matter latter”.
Last but not least, the advice I’d give you is learn lazygit.
5
u/emarko992 Oct 18 '26
https://learngitbranching.js.org/
5
u/RevRagnarok Oct 18 '26
A one-hour preview talk from 2007 by Randal Schwartz (of perl fame)
git rebase- in my experience, it's rarely used6
u/parkotron Oct 18 '26
Pro Git is great and free. It is always my starting recommendation. I’m not familiar with with Head First Git.
3
u/zenware Oct 18 '26
There’s about ~8 git commands you’ll use regularly and perhaps ~200 that you might possibly go your whole career never needing to know about.
If as a CS student you really want to learn Git, I’d recommend the free documentation on Git’s own site. (Which does include a full copy of Pro Git) but like… start with the Cheat Sheet if you want to be productive tomorrow. Then in the book you wanna read “Distributed Workflows”, for collaboration reasons, and maybe “Git Internals” for CS education reasons.
4
u/JONESY-B Oct 18 '26
watch like a random youtube video and and your set. spend 30 minutes learning about git and you good. Git basics arn't hard
2
u/Professional-Motor96 Oct 18 '26
Just build something , storing changes as u go with git. Use pull requests on GitHub. Have multiple branches at same time. I don’t know anyone who read about git before first using it.
Just learn checkout, merge, rebase, pull, fetch and push.
1
u/Abadabadon Oct 20 '26
As a swe ill tell you 90% of what git has to offer will not be used by you. Even if you just use the cli, most of your coworkers will think youre a wizard.
Given that, id reccomend really to just find an open source project and try modifying a file that is already in an open mr. Then open an mr to merge into the open source's main.
Sorry I know i did that thing where you ask a question and I dont answe it directly
1
u/FingerAmazing5176 Oct 18 '26
Scott chacon (author of progit) has git butler and had a few really good videos on YouTube about leaser know got things. It was really interesting.
1
u/richbl_reddit Oct 18 '26
I mentioned this in a previous thread... but I really prefer to learn something and then do something in the proper context (helps with memory retention). Plus, actually doing something is a lot more fun! :)
That said, I'd highly recommend WebTerm Learn. Beyond a very comprehensive Git Fundamentals course, the site also includes a number of other equally fun and useful tutorials.
Very highly recommended!
1
u/CaptainEdMercer Oct 18 '26
This is what's made Git finally clixk for me, the Git Parable... https://tom.preston-werner.com/2009/05/19/the-git-parable.html
1
u/v_valentineyuri Oct 19 '26
I'm very fond of Ry's Git Tutorial, was my introduction to Git in uni and it help me understand pretty much everything you need to know to start working with it. Note that it expects you to follow along with the exercises provided but I believe for most of us beginners that's something good.
1
u/Muted-Bid6584 Oct 19 '26
https://gitmission.com/
you can also try this for free no login required
1
u/DataPastor Oct 19 '26
Find a good 10 mins long video about Git and that’s all you need. Everyday use is not a rocket science, you need only a couple commands + practice it a bit. Rebasing can be rather challenging, but you can ChatGPT out if you are in trouble, how to recover branches, force merge etc.
1
u/ostadsgo Oct 19 '26
You are going to learn the rest in a project more than 50k loc
1
u/congruent-mod-n Oct 24 '26
This blog post has been around forever. It’s a quick read and teaches you enough theory behind git data structures that the commands make sense:
https://eagain.net/articles/git-for-computer-scientists/
1
u/unndunn Oct 18 '26
Git really doesn’t take that much to learn. You just need to understand the underlying commit graph and how the basic commands affect it. Takes about a day, max.
I’d say just find a nice YouTube video about it.
1
u/AndrewBorg1126 Oct 18 '26
Typing git help in the terminal is a great option.
Once you understand what a git repository really is, all you need is to find the commands that do whatever you already know is possible.
1
u/anondevel0per Oct 18 '26
Hi. The modern engineer needs to know approx 5-10 git commands. Don’t let anyone else tell you otherwise.
1
u/TarnishedVictory Oct 18 '26
Command line git is pro git. Learn the command line. Then you'll know what these GUIs are doing behind the scenes.
0
u/tinmanjk Oct 18 '26
none, Learning git in a month of lunches. It has exercises and very nicely laid out path.
0
u/Ok_Specialist413 Oct 18 '26
ma man, a book might have good content, but you"ll only understand theory (well i didn't read it so i can't really "judge" it), however i recommand you https://gitualize.com/ it offers beginners scenario to follow, understanding many of known commands and their option visually so you can try everything on you local machine
0
u/jake_morrison Oct 18 '26
The most important thing is using git to support your work and to collaborate with others. If you are using trunk-based development, it’s not necessary to worry about tricky merging processes.
For your individual work, simply commit frequently and push to GitHub to avoid losing work and be a low to roll back to a previous version when things don’t work out. This is also a good way to work with Claude.
When working on a team, you can do the same, relying on git tools to identify conflicts and help resolve them. Most professional teams use pull requests and peer reviews to merge changes into the trunk.
Set up a CI/CD system in GitHub Actions to automatically run tests and deploy to a test environment.
If you do these things, you will know git well enough.
0
u/CheetahChrome Oct 18 '26
Steps:
Then learn why/how teams use localised branching before merging into Main.
I still prefer the git command line for 90% of my work and set up aliases for specific commands based on where I am working in the check-in (not the git term) life cycle that I am in that make sense to me wholistically.
-3
u/Hamburgerfatso Oct 18 '26
Mfers reading books to learn git lmfao, just watch a 20 minute basics tutorial and play around with it yourself then just use it in your coding projects. Anything beyond the basics you will learn over time as you encounter a need for them