我的Git从不同的帐户拉/推记录

时间:2016-12-28 06:16:14

标签: git git-bash git-push git-pull git-config

如何在拉/推期间更改git中的帐户?

每当我拉/推时,我在我的终端使用git bash。之后,它在我们的回购活动中显示我 PUSHED 作为不同的人。

以下是一个示例:'name-of-other-account-here'推送到分支主管

应该是:'my-account-here'推送到分公司主人

1 个答案:

答案 0 :(得分:2)

更改user/email中的git config

# Change just for a single repo. Go into the repo.
$ git config --local user.name <your-name>
$ git config --local user.email <your-email>

# Or, change globally (for all repos)
$ git config --global user.name <your-name>
$ git config --global user.email <your-email>

$ git config --list       # check 'user.name' and 'user.email' 
相关问题