Compressing many commits into fewer, but larger, commits
I git-commit everything I do every hour. This is nice but I end up with way too many commits.
I’d like to be able to purge this so that instead of :
1 hour ago 2 hours ago . 23 hours ago 24 hours ago
I just have something like:
1 hour ago 2 hours ago 1 day ago 7 days ago
Currently each hour I do:
git-add . git-commit -a
How can I remove certain commits? I don’t want to undo any changes. I just don’t care to have quite so many points to revert to. I’d like to have a lot of commits for the past few hours but then only a few after that (the past day, week, month, etc. or other major points that I keep on purpose).
One Solution collect form web for “Compressing many commits into fewer, but larger, commits”
Have a look at the
git rebase -i command. This lets you ‘squash’ commits into larger ones, which seems like what you want to do.