推向github的问题 [英] problem in pushing to github
问题描述
我在github上创建了一个名为pygame的仓库。创建一个克隆并添加文件并提交。但是当我尝试推送时,我收到以下错误:
git push -u origin master
错误:请求的URL在访问https://github.com/amalapk/pygame/info/refs
时返回错误:403致命错误:HTTP请求失败
我可以ssh到 git@github.com
和收到我成功登录的通知,但无法推送到我的存储库。
您需要在您的项目的URL中包含您的用户名,格式为
https:// user@github.com/project / ...
例如,为我的测试github提供的URL是这样的:
https://github.com/jdblair/test.git
如果我将我的用户名添加到它,就像这样,那么我可以从github中push和pull,没有任何问题:
https://jdblair@github.com/jdblair/test.git
使用包含从克隆项目时开始的用户名的URL是最简单的。
您可以更改现有项目的URL如下所示:
git remote set-url来源https://user@github.com/project /foo/bar.git
您可以如果你愿意,可以使用ssh认证,但这是一个独立的安装过程。
I have created a repository on github named pygame. Created a clone and added files and commited.but when I attempt to push I receive the following error:
git push -u origin master
error: The requested URL returned error: 403 while accessing https://github.com/amalapk/pygame/info/refs
fatal: HTTP request failed
I can ssh to git@github.com
and receive the notice that I logged in successfully, but can't push to my repository.
I recently experienced this problem when setting up a new clone of my github project.
You need to include your username in the URL to your project, in the form
https://user@github.com/project/...
For example, the URL provided for my test github is this:
https://github.com/jdblair/test.git
If I add my username to it, like this, then I'm able to push and pull from github with no problem:
https://jdblair@github.com/jdblair/test.git
It is easiest to use the URL that contains the username starting from when you clone a project.
You can change the URL for an existing project like this:
git remote set-url origin https://user@github.com/project/foo/bar.git
You can use the ssh authentication instead if you want, but that's a separate setup process.
这篇关于推向github的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!