We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有这么一个需求,我们在新建项目的时候,忘了修改name和email,沿用了global中的设置,如果提交了一次commit,可以使用:
name
email
global
git commit –amend –author=‘[email protected]’
修改上一次提交的author信息
但是,如果提交过不止一次,就不能使用这个方法了。下面是一个批量修改的办法:
#!/bin/sh git filter-branch --env-filter ' OLD_EMAIL="[email protected]" CORRECT_NAME="Your Correct Name" CORRECT_EMAIL="[email protected]" if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] then export GIT_COMMITTER_NAME="$CORRECT_NAME" export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" fi if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ] then export GIT_AUTHOR_NAME="$CORRECT_NAME" export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" fi ' --tag-name-filter cat -- --branches --tags
此方法出自github help
这里有关于这个问题的更多讨论
The text was updated successfully, but these errors were encountered:
No branches or pull requests
有这么一个需求,我们在新建项目的时候,忘了修改
name
和email
,沿用了global
中的设置,如果提交了一次commit,可以使用:修改上一次提交的author信息
但是,如果提交过不止一次,就不能使用这个方法了。下面是一个批量修改的办法:
此方法出自github help
这里有关于这个问题的更多讨论
The text was updated successfully, but these errors were encountered: