Currently when I\'m using GIT I create a branch for each job and make various commits before I\'m finished. I then merge back with my master branch and push upstream. I\'m l
As mentioned in "Trimming GIT Checkins/Squashing GIT History", if your commits c and e were done with a comment prefixed with fixup!, then the rebase --interactive --autosquash (git1.7+, February 2010) can do exactly what you are after.
with the
fixup!directive, you could keep that squashing "invisible" in the commit message, while still benefiting from the automatic commit reordering with the --autosquash option.
To commit with a fixup! prefix, you can define the alias
[alias]
fixup = !sh -c 'git commit -m \"fixup! $(git log -1 --format='\\''%s'\\'' $@)\"' -
squash = !sh -c 'git commit -m \"squash! $(git log -1 --format='\\''%s'\\'' $@)\"' -
The fixup alias would then apply for those "commits (which) are just save points, i.e. not that important in the grand scheme of things".