from Hacker News

Show HN: I Wrote a Book on Git

by raju on 1/25/22, 2:50 PM with 0 comments

Hello everyone!

In 2020 I was approached by O'Reilly (I am one of the instructors on their online platform) to see if I wanted to work on a book on Git. And not just any book, a Head First book.

I have always been a huge fan of Git, and have been using it since 2009. I regularly teach Git at conferences, online platforms like O'Reilly's, and the occasional corporate training gig. So I figured, why not?

For those who are familiar with the Head First series, Head First Git is one of the first with a newer and more contemporary L&F. Gone are the stock photos—rather almost all images in the book are illustrations (done by someone at O'Reilly). Also, my book uses a very diverse set of characters in every chapter—we have Sangita, Brigitte, Trinity, Armstrong, Gitanjali and Aref and a few others who'll join you on your trip as you learn Git.

For those NOT familiar with the Head First series, IMO it is a truly unique approach to teaching ideas. It uses a very conversational style, with light-hearted narratives woven through every chapter to teach ideas concretely. The books use a variety of techniques to help truly cement ideas—there is a lot of repetition, dozens of hands-on exercises, and lot of quizzes—even crossword puzzles. AFAIK Head First is truly a class of books on its own, though Manning's "grokking" series is one that comes to mind that is attempting to do something similar (and doing so very well).

As for the intended audience, I am thinking most HN'ers are NOT the target audience. This book is directed towards folks very new to Git, and the hope is get them to 80% of what they need to know to use Git effectively.

My approach in writing this book (despite it targeting beginners) was not only to teach _how_ to use Git, but also _what_ happens when you do things to Git's DAG and the working directory/index/object datastore. The book uses a LOT of visualizations to explain what happens when you add and commit your work, and how operations like merging, reverting/reseting affect the DAG.

The book is done, available on O'Reilly's platform if you have an account and now on Amazon. I'd love to hear your feedback if you decide to take a look at it. My email is raju.gandhi @ the biggest search engine company in the word and my twitter is https://twitter.com/looselytyped (DM's are open), LinkedIn is https://www.linkedin.com/in/rajugandhi/

This is my second book (first one is from Apress) so if anyone here is interested in knowing what it takes to write a book, or in particular a Head First book, I'd happy to share everything I've learned. Feel free to post a comment here, or email/@ me on Twitter or LinkedIn.

Finally, a shout out to the awesome community that is Hacker News. I saved dozens of insightful comments, tips/tricks, articles about Git that showed up here and while many of the advanced tricks did not make it into the book, they certainly made me better at Git. Thanks everyone!

In case my site gets hugged to death:

https://www.amazon.com/Head-First-Git-Learners-Understanding...

https://learning.oreilly.com/library/view/head-first-git/978...