r/programming • • Jun 19 '15

GitFlow considered harmful

http://endoflineblog.com/gitflow-considered-harmful
13 Upvotes

244 comments sorted by

View all comments

Show parent comments

8

u/[deleted] Jun 19 '15

You use rebase -i to get rid of "Oops fix comment" ''Oops fix indentation" "Oops fix small name" and put all these small fixups into the change that they are associated with, which keeps the history cleaner.

Yes, but only if you haven't pushed those commits upstream yet. If you already pushed commits with small errors, it's tough luck and you'll have to use the "oops small fix" commits.

1

u/ForeverAlot Jun 19 '15

Or you can rebase and force-with-lease, which is really entirely safe in a controlled environment.

1

u/[deleted] Jun 19 '15

Not sure what that is. What I usually do is commit to a remote branch, and before merging that branch into master, I tidy it up locally if there were any dirty commits in there.

1

u/ForeverAlot Jun 20 '15

That's fine if you can justifiably skip a post-rebase review.

force-with-lease, which is a recent addition, is force with seatbelts: it accepts a push if and only if the remote ref is where you think it is, preventing the case of overwriting history you are not aware of.