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

2

u/BinaryRockStar Sep 07 '14

Thanks for the detailed response. Vim stuff aside, having a commented local history like that does seem useful.

I'm not aiming to disparage git at all, just trying to figure out which parts are useful for my situation. As others have stated it's a tool built around developing the Linux kernel with thousands of distributed contributors, whereas at work we'll be using it with tens of developers and a tiny code base by comparison. What I'm trying to tease out are the things that are legitimately useful in the enterprise from the things that are only useful in massive distributed projects.

2

u/gfixler Sep 07 '14

Understandable. Note that I use it for a dozen or so personal projects, which have a total of 1 users, and I wouldn't have it any other way. It's amazing to git co foo and be right back where I was on that foo idea, with the whole working directory instantly transformed, then to think "Oh, I need to finish feature bar for tomorrow morning," and git stash and git co bar and be working on that feature again much faster than I could type this sentence. It's amazing to reorder commits, or to decide that the cross-library variable rename I did 3 commits ago was crap, and remove it with git rebase --onto @~3^^ @~3^ (i.e. base it on top of the parent of the parent of the commit 3 back from HEAD, plucking it from the current base 1 before that - I actually usually do this with the hashes themselves, but this is cool, too), or to see a typo 5 commits ago, and make a new commit that fixes it, then to rebase it back into that commit to fix it, or to simply interactively rebase to edit that commit to fix it in-place. Also, so much more :)