git push origin master failed
我想将我的代码推送到github.com。git push origin master failed
我用的Win XP和git-bash的1.7.2.3
而且我得到了以下的ssh测试过程中成功的消息。
但是“git push origin master
”命令需要用户名和密码。
debug1: Entering interactive session.
ERROR: Hi xxx! You've successfully authenticated, but GitHub does not provi
de shell access
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to github.com closed.
debug1: Transferred: stdin 0, stdout 0, stderr 34 bytes in 0.7 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 51.8
debug1: Exit status 1
[email protected] /d/project/clojure/anagram (master)
$ git push origin master
Username:
`fatal: Could not read password: No such file or directory`
您是否设置了您的GitHub ID? (因为GitHub的是基于Token identification)
git config --global github.user "your-github-username"
git config --global github.token "your-github-token"
关于Vasileios Lourdas的answer有关SSH,确保是什么$HOME
在一个Git bash命令值。
[email protected] ~
$ pwd
/c/Users/VonC
[email protected] ~
$ echo $HOME
/c/Users/VonC
在Xp上,那将是c:\Document And Settings\VonC
。
含义SSH公开密钥文件id_rsa.pub必须有路径:
c:\Document And Settings\VonC\.ssh\id_rsa.pub
你必须创建一个SSH密钥并上传公钥github上,这样它就能使用密钥进行验证, 。我认为在Windows中,ssh密钥位于配置文件的.ssh文件夹内(c:\documents and settings\<username>
)。因此,创建密钥并将id_rsa.pub(这是名称,除非您更改它)的内容上传到Github。
我做到了。但它不起作用。 – jeon 2010-09-19 13:32:09
这可能是使用HTTPS接口的问题。切换到目录并运行“git remote -v”列出您的遥控器配置方式,然后发布。
我做到了。但它不起作用。 – jeon 2010-09-19 13:32:41
@rafael:我用明确的路径更新了答案。 – VonC 2010-09-19 14:25:35
@VonC:对于迟到的回复感到抱歉。 rafael @ NETBOOK-RAFAEL〜/ .ssh $ echo $ HOME /c/Documents and Settings/rafael – jeon 2010-09-26 14:53:22