【发布时间】:2016-05-14 12:07:16
【问题描述】:
我无法将更改推送到 github 上的远程存储库。我收到此身份验证错误:
remote:旧用户拒绝 newuser/repository.git 的权限。 致命:无法访问 'https://github.com/newuser/repository.git/':请求的 URL 返回错误:403
(我替换了我的实际用户名和存储库) 我正在将一个项目迁移到一个新帐户,而 git 正在尝试使用我的旧用户凭据进行身份验证。 我取消设置全局“user.name”(即“olduser”)并将本地“user.name”设置为“newuser”。现在我的配置如下所示:
core.editor=Sublime
filter.lfs.clean=git-lfs clean %f
filter.lfs.smudge=git-lfs smudge %f
filter.lfs.required=true
push.default=simple
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/newuser/repository.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
user.name=newuser
我也曾尝试添加一个 osxkeychain 作为凭证助手,但我认为这并不能解决任何问题。我不知道如何解决这个问题。
感谢您的帮助!
【问题讨论】:
标签: git macos authentication github credentials