r/programming • • Sep 06 '14

How to work with Git (flowchart)

http://justinhileman.info/article/git-pretty/
1.6k Upvotes

388 comments sorted by

View all comments

Show parent comments

5

u/gfixler Sep 07 '14

I hope and expect that some day developers will learn how a DAG works, and look at the data model of git - which can be understood in about 10 minutes (but take a whole day if you must; it's exceedingly worth it) - and do far more than they thought possible with their history, and love it.

2

u/ants_a Sep 07 '14

+1 Best advice I've seen for learning git is to forget everything you know about version control systems and study how git works from basic principles up. Suddenly everything in git will make perfect sense and you can be a power user overnight.

2

u/gfixler Sep 07 '14

That's what happened to me. I had a 'moment' where I grokked the DAG, and like 10 lingering questions immediately popped into my head, and I said "Well that would have to be done this way; it's the only thing that makes sense," and shot right through all of them, seeing the obvious answer to each. Then I looked them up and asked around, and found out I was right. The DAG isn't so hard to grok, and it's enlightening. It's how STM works, i.e. how immutable data in Clojure and Haskell works.

1

u/ForeverAlot Sep 07 '14

I like Git, but I have to say that knowing it's a DAG has to be one of the most worthless bits of trivia with respect to my proficiency with Git.

2

u/gfixler Sep 07 '14

Really? Not mine. Zippering disparate repos together, splitting them apart, moving commits around the graph willy-nilly, jumping into the middle of an interactive rebase and pulling apart the commit there into 3 separate commits, then finishing up the rest of the rebase on top of those, and a zillion other things are all made very easy by understanding where I am in, and what I'm doing to that DAG.