Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git在更改后仍然可以看到我的最后一个user.name_Git - Fatal编程技术网

Git在更改后仍然可以看到我的最后一个user.name

Git在更改后仍然可以看到我的最后一个user.name,git,Git,我已将用户名和电子邮件更改为新帐户: 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 u

我已将
用户名
电子邮件
更改为新帐户:

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

怎么办???!他在哪里看到新用户名

为了充实@RaymondChen所说的,你不一定是在推动自己的承诺,如果你是QA-meister或类似的中尉,你可以很容易地推动十几个或一百个不同的人的承诺。首先重要的是您是否有权推送到该回购,审查内容本身是一项单独的任务。

git credential manager uninstall
git push
不关心您的
user.name
user.mail
。它使用您的凭据存储中的凭据。因此,如何删除该
newUser
并成为
oldUser
?Shieeet,最后只有这一点有帮助:
git credential manager uninstall