问题描述
我有一个github帐户。当我提交时,它显示的用户名不同于我的github帐户用户名。我该如何解决?
解决方法
在本地文件夹的根目录下,有一个名为“ config”的文件。 尝试“ vim .git / config”
文件看起来像这样:
[core]
repositoryformatversion = 0
fileMode = false
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://nanhe@bitbucket.org/nanhekumar/myproject.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master`
[user]
name = Nanhe Kumar
email = info@nanhekumar.com
一些选择:
- 更改此文件中的用户名和电子邮件
- 使用“ git config”命令更改要推送到github的全局用户或特定文件夹项目的本地用户:
本地:
- git config --local user.name“”
- git config --local user.email“ ”
全局:
- git config --global user.name“”
- git config --global user.email“ ”