Github Push上的权限被拒绝错误

Irf*_*fan 50 git github

最近,我被添加为Github项目的成员/贡献者.我已经在本地机器上克隆了该项目.

我已经做了一些更改并在本地提交,现在尝试将更改推送到原始仓库但是当我尝试推送时,我得到一些权限错误?

C:\Users\MM\Documents\GitHub\software-licensing-php [master]> git push
origin master
remote: Permission to EasySoftwareLicensing/software-licensing-php.git denied to
 irfandayan.
fatal: unable to access 'https://github.com/EasySoftwareLicensing/software-licen
sing-php.git/': The requested URL returned error: 403
C:\Users\MM\Documents\GitHub\software-licensing-php [master]> git statu
s
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
#   (use "git push" to publish your local commits)
#
nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)

我是否缺乏推动变更的许可,所以我可以问项目的原作者?

cnd*_*cnd 120

  • 单击原始github项目页面上的fork按钮
  • 克隆你的分叉存储库而不是原始的
  • 推动它
  • 按存储库上的Pull Requests按钮
  • 创造它
  • 等待原作者接受它


Lua*_* Ho 50

当我通过git config --global user.email更改我的用户电子邮件时,我曾经遇到同样的错误, 并在此处找到我的解决方案: 转到:控制面板 - >用户帐户 - >管理您的凭据 - > Windows凭据

Generic Credentials下,有一些与Github相关的凭据,单击它们并单击" 删除 ".

当你试图推送东西时,你需要再次登录.希望这对你有所帮助

  • 将我的 ssh 公钥添加到 github 后,应用您的解决方案对我来说是有效的。 (2认同)
  • 为我工作。我在 github 上有多个帐户,因此 git 使用在凭据管理器中配置的帐户。通过删除这些引用,我能够重新进行身份验证。 (2认同)

小智 20

能够通过在下面的URL中提供用户名和密码来解决此问题.

请用您的github credentauls替换用户名和密码

git remote set-url origin https://<username>:<password>@github.com/narulasrinivas/FirstRepository.git
Run Code Online (Sandbox Code Playgroud)


Sha*_*baz 6

请参阅有关克隆 URLgithub 帮助。使用 HTTPS,如果您无权推送,您基本上将拥有只读访问权限。所以是的,你需要征求作者的许可。

如果作者没有给你许可,你总是可以分叉(克隆)他的存储库并自己工作。一旦你制作了一个很好的和经过测试的功能,你就可以向原作者发送拉取请求。


mlu*_*noe 6

出于某种原因,我的推和拉原点已更改为HTTPS-url而不是SSH-url(可能是我端的复制粘贴错误),但是尝试推入会在尝试登录后给我以下错误:

Username for 'https://github.com': xxx
Password for 'https://xxx@github.com': 
remote: Invalid username or password.
Run Code Online (Sandbox Code Playgroud)

使用SSH网址更新远程源,解决了以下问题:

git remote set-url origin git@github.com:<username>/<repo>.git
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助!