首次使用GitHub时,尝试"git push"时收到错误403 [英] First time using GitHub, getting error 403 when I try 'git push'
问题描述
我遇到以下错误
remote: Permission to sokratus/xxxxxxxxxxxxx.git denied to user-name2.
fatal: unable to access 'https://github.com/sokratus/xxxxxxxxxxxxx.git/': The requested URL returned error: 403
用户名2属于我的一个朋友,我不确定为什么它会出现在我的计算机上.
The user-name2 belongs to one of my friend and I'm not sure why is it coming up on my computer.
推荐答案
这是因为您正尝试推送到朋友的存储库&您无权这样做.这可能是您所做的:
This is because you are trying to push to your friend's repository & you do not have permission to do so. This is probably what you did:
git clone https://github.com/sokratus/xxxxxxxxxxxxx.git/
## did something, git add or git commit....
git push
默认情况下,git push将信息推送到原点,您可以执行以下操作来检查原点指向的存储库:
By default, git push pushes to the origin, you can check the repository to which origin points to by doing :
$ git remote -v
# which will give you something like this
origin https://github.com/sokratus/xxxxxxxxxxxxx.git/
如果要推送到原点,则需要访问它.或者,如果要将其推送到自己的github存储库中,则需要创建一个新的遥控器,如下所示:
If you want to push to the origin, then you need access to it. Or if you want to push it to your own github repository, then you need to create a new remote, like this:
$ git remote add my_origin <your github repository's url>
$ git push my_origin
这篇关于首次使用GitHub时,尝试"git push"时收到错误403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!