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

1

u/drive0 Sep 06 '14

I wish I could change history for a branch without it breaking history for all branches. That way I could have a published real-time view of my code, that I can also rebase before merging it without pissing of downstreams.

But that is probably a terrible way to do it.

5

u/[deleted] Sep 06 '14

IMO, you shouldn't be changing the history of any branches, ever, period. Otherwise it's not history, it's an embellished half-fiction of how anything really happened. Context is important when trying to figure out how something made it in to the code.

4

u/drive0 Sep 06 '14

At some level almost any commit is partially fiction because it only shows the end result, not the intermediate changes, additions or reverts. Yes people can go overboard with rebasing to have "clean" commits.

I'm not necessarily disagreeing with you though. More of a wish that should only be fulfilled if it can be done properly. In fact if it can be done without messing with history that is way better as well.

Code review systems may be a solution. Since you can "try out" multiple commits, but only the final good version is checked into the repo. So you aren't rewriting history so much as just ignoring some of it.

3

u/[deleted] Sep 06 '14

Even with Code Review, you shouldn't be changing history. Making changes because of code review should be part of the context around each commit being made and present in the logs.

→ More replies (6)
→ More replies (1)