我正在使用GIT作为我的项目。现在我想将它与github上整合,所以我创建了一个远程:远程Pushurl将不起作用
git remote add github https://[email protected]/WouterJ/project.git
但现在我需要一个密码,以填补取,东西,我不想要的。所以我决定使用不同的URL进行获取:
git remote set-url github http://github.com/WouterJ/project.git
git remote set-url --push github https://[email protected]/WouterJ/project.git
如果我跑git remote -v
我得到这个:
$ git remote -v
github http://github.com/WouterJ/project.git (fetch)
github https://[email protected]/WouterJ/project.git (push)
origin http://github.com/WouterJ/project.git (fetch)
origin http://github.com/WouterJ/project.git (push)
到底要我想要的,我想。但是当我推动我需要填写我的用户名。为什么?如果我直接推到URL如果填充它完美的作品:
git push https://[email protected]/WouterJ/project.git master
作品,但
git push github master
都不行
我还使用了git config
设置不同的推送网址:
git config remote.github.pushurl https://[email protected]/WouterJ/project.git
如果我从配置得到pushurl它看起来是正确的:
$ git config remote.github.pushurl
https://[email protected]/WouterJ/project.git
而且看的.git/config文件,它看起来像一切是正确的。
我在这里错过了什么吗?这是一个错误吗?我使用Git1.7.4,那是错的吗?
非常好。 +1。我以为你使用的是Git1.7.4(它已经高于1.7.0) – VonC
等等,我输入了Git1.7.0,但是意味着Git1.7.10.1(最新的稳定版本)。谢谢,我会编辑它 –
好吧,现在我明白了;)我正在做1.7.9和1.7.10的测试,但没有能够重现您的问题,以便确认它。 – VonC