Re:Torvalds: git vs CVS
by nuclear_eclipse on Friday April 16, 2010 @05:59PM
(#1272068)
Git makes this easy. It supports "rebasing" commit trees, and for what you want, a "squashed" rebase is absolutely trivial to do.
git rebase --interactive <commit> should help
http://stackoverflow.com/questions/598672/git-how-to-squash-... and
http://stackoverflow.com/questions/435646/how-do-i-combine-t...
I do this all the time with git. I create a branch, do all my incremental commits, get it all working. Then I merge it into the mainline as one squashed commit. There a few guides on how to do it with the command line but I'll admit I've gotten lazy and now just use smartgit which lets me do it easily without having to remember the commands.
git already has this in core and bzr has a rebase plugin[1]. I think this problem has been solved for quite some time now :)
[1] http://doc.bazaar.canonical.com/plugins/en/rebase-plugin.htm...
Suppose I sit down for a collaborative session with someone. Over the course of a few hours, we might generate 10-100 commits between the two of us, and several branches, all to implement a single feature. I.e., I commit, say "hey, pull from me, you had an off by one a few minutes ago."
At the end of the session, we only want to generate a single commit to the public repositories.
Mercurial queues are a tolerable way to handle this, but they aren't great.