【发布时间】:2015-12-18 18:39:27
【问题描述】:
当我尝试 git push 时,我看到了这条消息:
远程:PavelMetsko 拒绝 Karetski/univercube.git 的权限。 致命:无法访问“https://github.com/Karetski/univercube.git/”:请求的 URL 返回错误:403
但在 git config 我看到另一个用户名
push.default=simple core.autocrlf=true user.email=karetski@gmail.com user.name=Karetski core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true core.ignorecase=true core.precomposeunicode=true remote.origin.url=https://github.com/Karetski/univercube.git remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* branch.master.remote=origin branch.master.merge=refs/heads/master
如何解决这个问题?我需要“Karetski”用户名而不是“PavelMetsko”
【问题讨论】:
-
.gitconfig 存储在 3 个位置。每个系统、每个用户和每个存储库。它们可以相互覆盖。你都检查了吗?
-
我检查了 --global 配置和存储库配置。我在哪里可以找到其他的?我使用 OS X Yosemite
-
Git 不提供用户名(也不提供密码)。当使用 https 作为你的协议时,它是一个提供这些的“凭证助手”。有关详细信息,请参阅help.github.com/articles/caching-your-github-password-in-git。 (使用 ssh,git 仍然不提供用户名或密码,但使用 ssh 的设置对我来说似乎更简单。)
-
谢谢@torek。你的回答太棒了。真的很有帮助!!!
-
这能回答你的问题吗? How do I update the password for Git?