【问题标题】:My Git Pull/Push records from different account我的 Git 从不同帐户拉/推记录
【发布时间】:2017-05-12 09:40:07
【问题描述】:

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

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

这是一个示例:'name-of-other-account-here' 推送到分支 master

应该是:'my-account-here' 推送到分支 master

【问题讨论】:

  • 使用 git config 更改配置
  • git config user.email 。 git config user.name 来配置你的本地仓库。

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


【解决方案1】:

将您的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' 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-05-23
    • 1970-01-01
    • 1970-01-01
    • 2015-04-11
    • 2020-10-27
    • 1970-01-01
    • 2017-01-31
    • 1970-01-01
    相关资源
    最近更新 更多