我认为挑选并减少提交是件好事.要设置提交的作者,只需使用git commit --author="The Original Author <his@address>".
举个例子,如果f414f3l是你要减少的提交,我可能会做以下事情:
# Make sure you're on the branch you want to create the new commit on:
git checkout master
# Now cherry-pick the commit, but only stage the changes:
git cherry-pick -n f414f3l
# Choose which hunks you want to unstage interactively, using the 's'
# option to split them where necessary. (Or using the 'e' option for
# complete control over what patch to unstage.)
git reset -p
# When you commit, the commit message should be preserved:
git commit --author="The Original Author <his@address>"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1147 次 |
| 最近记录: |