Bom*_*mbe 22
查找一位作者的所有提交并将其哈希值保存到文件中:
git log --author=<author> --format=%H > /tmp/commit-by-x
Run Code Online (Sandbox Code Playgroud)
创建一个不包含此特定作者提交的新分支,因为您不想应用它们两次.为此,您可以创建一个新的空分支:
git checkout --orphan commits-by-x
Run Code Online (Sandbox Code Playgroud)
Cherry挑选该作者的所有提交(从最旧到最新):
tac /tmp/commit-by-x | while read sha; do git cherry-pick ${sha}; done
Run Code Online (Sandbox Code Playgroud)
显然,如果你希望这个成功,那么author-x引入的更改必须非常本地化.