Massive git commit squashing
My company is in the 开发者_JAVA技巧middle of converting from CVS over to git. We've been on CVS for a long time, so there is a huge history. Too much to do by hand.
Looking at the logs, there is a lot of squashing that could be done. A whole lot. What I would like to do is hook in a script that will compare two adjacent commits. If it returns true, then concatenate the commit messages and squash the commits. I would also be happy with a command that accepts two commits and a commit message, then squashes them together.
git rebase --interactive is close to what I need, but "squash" requires far too much manual intervention. I also looked at using "fixup" instead of squash, but I don't want to lose the commit messages.
Any ideas?
How about --autosquash?
You could combine it with git filter-branch to script renaming the commits. (A word of warning, though. Be careful with filter branch, and read the warnings in its man page. It's not a command for the faint of heart.)
精彩评论