2013-11-01 143 views
7

我有一个git repository。我在Windows ADT中有一个GUI客户端,在Eclipse ADT中有EGit。通常我在Eclipse ADT中编辑并使用GUI客户端来更新Github库。首先我提交(它创建一个缓冲区),然后当我同步时,它将它上传到我的实际仓库。错误:请求的URL返回错误:403访问时禁止访问

现在我克隆了Linux上的我的回购(CentOS 6.4)。一切都安装好了。我改变了一些文件。然后我用git addgit commit -m "message" -a命令,它工作正常。但我的实际github回购没有更新。经过一番搜索后,我发现我们必须明确提供git push命令。之后我得到

[[email protected] Android]$ git push 
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/aniket91/Android.git/info/refs 

fatal: HTTP request failed 

什么问题出在哪里?没有防火墙或代理服务器,并且我已经靠近iptables服务。有没有人遇到过这种情况?应该做什么?

以下this的答案后(这样的工作,我得到了下面的错误)

[[email protected] Android]$ git push origin master 
The authenticity of host 'github.com (192.30.252.130)' can't be established. 
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. 
Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added 'github.com,192.30.252.130' (RSA) to the list of known hosts. 
Permission denied (publickey). 
fatal: The remote end hung up unexpectedly 

任何建议表示赞赏。

回答

2

answer you mention建议将url从https更改为ssh。

只有当你有一个~/.ssh/id_rsa~/.ssh/id_rsa.pub,而后者(公钥)发布在你的GitHub ssh keys中时,这才会起作用。

检查您的Egit ssh configuration

http://wiki.eclipse.org/images/8/87/Egit-0.6-003-SshPreferences.png

一步一步的程序,如何生成SSH密钥,并将其设置在GitHub上设置here是链接。

+0

我想要做的命令行使用** git push origin master ** –

+0

@AniketThakur然后检查您的SSH配置:http://stackoverflow.com/a/7927828/6309 – VonC

+0

感谢主要部分是生成SSH密钥并将其存储在您的github设置中。一步一步 - > https://help.github.com/articles/generating-ssh-keys –

0

所以我面临与git推送内容到存储库相同的问题。


错误信息:

错误:请求的URL返回错误:HTTP请求周围的失败


工作对我来说:访问https://github.com/bhanurhce/rhel6-exapmpleserver.git/info/refs

致命403禁止:

此错误主要是由于git集线器中本地计算机的登录凭据。 你必须提供github上

的用户名密码&添加用户名:$混帐配置--global user.name“bhanurhce” 用户名应该是GitHub的用户帐户。

确认用户名:$ git config user。命名

一旦你尝试推,然后它会问密码:

$混帐推-u起源主
密码:(提供您GitHub的密码)

问题就解决了。

即使你仍然得到错误askpass

错误信息: [根@虚拟主机的git]#混帐推-u起源主

(GNOME-SSH-askpass:47356 ):GTK的WARNING **:无法打开显示:

然后只是命令解决它:$ 未设置SSH_ASKPASS

所有将工作网络东北。希望它有帮助..

谢谢!

0

我有同样的问题,原因是我在我的Linux机器下使用https git访问。拉是好的,而推错以错误结束。解决的办法是改用ssh访问,例如:

,所以先阅读远程网址:

$ git config --get remote.origin.url 

https://github.com/yourname/project.git 

,如果你看到的是https然后将其更改为SSH,从GitHub的项目WWW复制正确的URL,并呼吁:

$ git remote set-url origin [email protected]:yourname/project.git 

你可能仍然需要把(也许还生成).ssh公钥给github。对于VonC的回答。

相关问题