更改后,Git仍然看到我的上一个用户名

时间:2018-10-29 23:46:52

标签: git

我已将user.nameemail更改为新帐户:

git config --global user.name "newusername"

git config --global user.mail "newmail@newmail.com"

然后,我将一些人员推送到newusername用户的github上的新帐户。然后,我已经注销,现在想向我的旧帐户发送邮件。我再次输入:

git config --global user.name "oldusername"

git config --global user.mail "oldmail@oldmail.com"

当我键入:

git config --list

然后我得到:

$ git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.helper=manager
user.email=oldmail@oldmail.com
user.name=oldusername
credential.helper=store
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=https://github.com/oldmail/oldproject.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

所以我克隆了我的项目,进行了更改,提交并在git push上得到了:

remote: Permission to oldusername/oldproject.git denied to newusername.
fatal: unable to access 'https://github.com/oldusername/oldproject.git/': The requested                                                                                                                                                                                                URL returned error: 403
 URL returned error: 403

如何???!他在哪里看到新用户名?!!

2 个答案:

答案 0 :(得分:1)

git credential-manager uninstall

答案 1 :(得分:0)

要充实@RaymondChen所说的话,您不一定要推送自己的提交,如果您是QA部长或某些中尉,则可以轻松地推送十几个或一百个不同的人的提交。首先重要的是您完全有权推送到该存储库,审核内容本身是一项单独的任务。