Hacker News new | ask | show | jobs
by onekorg 2374 days ago
The thing that made git click for me was to understand the data structures that make git work.

There's beauty and elegance in the implementation details of git. You can do and undo with confidence once you can translate the changes you want to make to git object transformations.

To get an overview of the concepts behind git I recommend this article by one of the GitHub founders: http://tom.preston-werner.com/2009/05/19/the-git-parable.htm...

To understand the data structures I suggest: https://codewords.recurse.com/issues/two/git-from-the-inside...

3 comments

Here also my 'git from scratch' TODO for the new year list : https://wyag.thb.lt/
This looks great!
> The thing that made git click for me was to understand the data structures that make git work.

I cannot agree with this more! The data structure makes git git, there are some questionable CLI design choices but they all melt away once you get the data structure.

In relation to trying to manipulate commits and "undoing things", everything will be significantly clearer the faster you can move away from thinking of undo like a one dimensional word processor function... Instead start to think of git as an immutable graph of commit objects you are able to traverse, reference and use in anyway - at that point "undo" seems like a completely inadequate description.

"understand the data structures that make git work" - insert relevant xkcd.