A "Squash" WorkFlow in Git 2

Posted by Justin Reagor Sat, 02 Aug 2008 17:04:00 GMT

By using Git, our workflows and environments are becoming much cleaner, there’s no denying that. I just wanted to post a quick note on how “squashing”, and more specifically interactive Git rebase, can extend that as well.

If your using Git you can squash tiny commits into a “lump sum” commit. This way you have the benefit of smaller commits while releasing only the real meat of changes your working on.

Its a tad dangerous messing with rebase, since it rewrites history, so try to learn how to do it on a separate test branch.

Personally, I’m trying to work this into my workflow by switching back to my master branch, merging down tiny changes from the other “working” branch, squashing them together, then pushing up (or others pulling down) or switching back to continue working/create a new branch for new functionality… whatever….

Plenty of people have blogged about this, so I’m not going to demonstrate how to do it, but here’s a link for learning more about it…

git awsome-ness [git rebase—interactive]

As usual, check the Git rebase manual page for more info…