I am trying squash many commits into a single one, the problem is that I need do that by author (name or email).
The case:
Lets say I have a branch called feature-a, in this branch I have many commits for many authors. How can I squash all commits by author (email for example) into a single commit. I want do that to be able to merge all author commits into master.
Any help here?
Thanks in advance
With Kenkron's caveats in mind, you could do a:
The
git log --pretty="format:%an %H" master..feature_a | sort -g
would sort the logs of thefeature_a
commits (not the ones frommaster
because of themaster..feature_a
syntax)You would still need to do an interactive rebase to squash the (now ordered by author) commits on
master
.