最近,我被添加为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)
我是否缺乏推动变更的许可,所以我可以问项目的原作者?
Lua*_* Ho 50
当我通过git config --global user.email更改我的用户电子邮件时,我曾经遇到同样的错误, 并在此处找到我的解决方案: 转到:控制面板 - >用户帐户 - >管理您的凭据 - > Windows凭据
在Generic Credentials下,有一些与Github相关的凭据,单击它们并单击" 删除 ".
当你试图推送东西时,你需要再次登录.希望这对你有所帮助
小智 20
能够通过在下面的URL中提供用户名和密码来解决此问题.
请用您的github credentauls替换用户名和密码
git remote set-url origin https://<username>:<password>@github.com/narulasrinivas/FirstRepository.git
Run Code Online (Sandbox Code Playgroud)
出于某种原因,我的推和拉原点已更改为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)
希望这可以帮助!