Squash is fixed on the author

The repository has a very large number of commits caused by automatic updates to the assembly tools in AssemblyInfo files (the project is in C #). They commit all the "Dev BuildAgent" as the author.

Is there a way to crush all commits in a repository from a particular author into the first child from another author?

Of course, one possibility would be to start the git rebase --interactiveroot commit using SHA and manually go through the commit list and apply the squash command to the corresponding commit manually. However, it would be useful to know if there is a faster option, bearing in mind a very large number of commits.

+4
source share
1 answer

foo@bar.com , . , , , , commiter email, committer name,...

git filter-branch --commit-filter '[ "$GIT_AUTHOR_EMAIL" = "foo@bar.com" ] && skip_commit "$@" || git commit-tree "$@"'
+2

Source: https://habr.com/ru/post/1650790/


All Articles