首页 > 解决方案 > Git如何使用不是我的昵称推送到远程

问题描述

我有自己的远程仓库,但我想用我的名字和姓氏而不是我的昵称来推送它。但是,没有一个git config选项对我有用。

标签: gitcommitauthor

解决方案


If You want to do this only for the last commit, You can reset the branch to the state before the mentioned commit, set proper details usinggit config and then make a commit and force push the last commit to the repo.

If however You would like to do this for multiple commits, then it is a little bit harder and requires rewriting the history. The script to do this has already been provided on StackOverflow: How to change the author and committer name and e-mail of multiple commits in Git?.


推荐阅读