远程Pushurl将不起作用 [英] Remote Pushurl won't work

查看:197
本文介绍了远程Pushurl将不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的项目使用GIT。现在我想将它与github集成,所以我创建了一个远程:

I'm using GIT for my projects. Now I want to integrate it with github, so I created a remote:

git remote add github https://WouterJ@github.com/WouterJ/project.git

但是现在我需要填写密码以获取密码我不想要。所以我决定使用一个不同的url来获取:

But now I need to fill in a password for fetching, something that I don't want. So I decided to use a different url for fetching:

git remote set-url github http://github.com/WouterJ/project.git
git remote set-url --push github https://WouterJ@github.com/WouterJ/project.git

如果我运行 git remote -v 我得到这个:

If I run git remote -v I get this:

$ git remote -v
github  http://github.com/WouterJ/project.git (fetch)
github  https://WouterJ@github.com/WouterJ/project.git (push)
origin  http://github.com/WouterJ/project.git (fetch)
origin  http://github.com/WouterJ/project.git (push)

完全想要我想要的,我想。但是当我推动我需要填写我的用户名。为什么?如果我直接推送到URL,如果填充完美的作品:

Exactly want I want, I thought. But when I do a push I need to fill in my Username. Why? If I push directly to the url if filled in it works perfectly:

git push https://WouterJ@github.com/WouterJ/project.git master

作品,但是

Works, but

git push github master

不会工作

我还使用 git config 来设置不同的推送网址:

I also used the git config to set a different push url:

git config remote.github.pushurl https://WouterJ@github.com/WouterJ/project.git

如果我从配置中获得pushurl,它看起来是正确的:

And if I get the pushurl from the config it looks like it is correct:

$ git config remote.github.pushurl
https://WouterJ@github.com/WouterJ/project.git

同样看着.git / config文件,它看起来像一切都是正确的。

Also looking at the .git/config file it looks like everything is correct.

我在这里错过了什么吗?这是一个错误吗?我使用Git1.7.4,那是错的吗?

Am I missing something here? Is it a bug? I use Git1.7.4, is that wrong?

推荐答案

我发现你可以解决这个问题,所以为了解决我自己的问题:

I have found how you can solve this, so to aswer my own question:

诀窍是上传到Git1.7.8(或更高版本)。现在,您可以使用相同的设置并且没有 _netrc 文件:

The trick is to upload to Git1.7.8 (or higher). Now you get this with the same settings and without a _netrc file:

$ git push github master
Password for 'https://WouterJ@github.com/':

$ git fetch github
fetching....

所以看起来bug在Git1.7.8中是固定的(版本说明

So it looks like the bug is fixed in Git1.7.8 (Release Notes)

这篇关于远程Pushurl将不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆