Skip to content

Instantly share code, notes, and snippets.

@zxhfighter
Last active October 21, 2019 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zxhfighter/39b89c6c44b6707af244c238439da3ec to your computer and use it in GitHub Desktop.
Save zxhfighter/39b89c6c44b6707af244c238439da3ec to your computer and use it in GitHub Desktop.
git 小提示

配置当前仓库用户名和邮箱。

git config user.name 'XXX'
git config user.email 'XXX'

或者

git config --local user.name 'XXX'
git config --local user.email 'XXX'

修改最后一次和多次的 author

修改最后一次的 author。

git commit --amend --reset-author

修改多次提交的 author。

git rebase -i HEAD~5

需要修改的 commitid 对应的 pick 修改为 edit。

git commit --amend –reset-author
git rebase –continue

按照提示进行上述修改即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment