Nat*_*unn 5 git bash terminal github
当我做一个git push我想出这个错误:
错误:请求的URL返回错误:访问https://github.com/nathandunn97/SchoolAdvisor.git/info/refs?service=git-receive-pack时出现错误400 :HTTP请求失败
我正在使用Ubuntu 13.04,我的git版本是1.8.1.2。
我在内部托管的git存储库上有与此类似的东西(所以我不是100%肯定会解决github上的问题)。“ Git pull”效果很好,但是“ git push”给了我:
error: The requested URL returned error: 400 while accessing http://10.3.231.11/fisheye/git/myrep.git/info/refs
Run Code Online (Sandbox Code Playgroud)
对我有用的是进入.git / config,并更改网址以在网址中包含我的用户名:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = http://username@10.3.231.11/fisheye/git/myrep.git
Run Code Online (Sandbox Code Playgroud)
然后在push命令后要求输入密码,然后成功推送文件。
当您使用 https 进行推送时,您可能每次都需要写入密码。为 git hub 生成 ssh 密钥
https://help.github.com/articles/generate-ssh-keys
然后将您的配置文件更新为 ssh url,您应该能够推送您的内容。