Git使用Windows从Openshift中拉出:无效的refspec [英] Git Pull from Openshift using Windows: Invalid refspec
问题描述
我在 Openshift 上创建了一个PHP应用程序,并成功将SSH应用到我的应用程序中。我在Openshift上的Git仓库与此类似: ssh://1234567890@my_app_name.rhcloud.com/~/git/app_name.git/
。我还在我的电脑上创建了一个本地Git存储库。我在这里保存了公钥和私钥(相对于本地回购): ../ ssh /
。我命名公钥和私钥是这样的: .ssh
和 .ssh.pub
我试图将Git pull从我的Openshift回购与以下:
I created a PHP application on Openshift and successfully SSH into my app. My Git repository on Openshift is similar to this: ssh://1234567890@my_app_name.rhcloud.com/~/git/app_name.git/
. I also created a local Git repository on my computer. I saved my public and private keys here (relative to my local repo): ../ssh/
. I named the public and private keys like this: .ssh
and .ssh.pub
I'm trying to Git pull from my Openshift repo with the following:
git pull ssh:../ssh/.ssh 1234567890@my_app_name.rhcloud.com/~/git/app_name.git/
fatal: Invalid refspec '1234567890@my_app_name.rhcloud.
com/~/git/app_name.git/'
但是我收到了错误致命:无效refspec
。
我也试过
I also tried
git pull ssh://1234567890@my_app_name.rhcloud.com/~/git/app_name.git/
但是我收到以下错误
权限被拒绝(publickey,gssapi-keyex,gssapi-with-mic)。致命:
无法从远程存储库读取。
Permission denied (publickey,gssapi-keyex,gssapi-with-mic). fatal: Could not read from remote repository.
请确保您拥有正确的访问权限并存在存储库
。
Please make sure you have the correct access rights and the repository exists.
如何在Windows上使用ssh从Openshift中取出?
How do I pull from Openshift using ssh on Windows?
PS:键使用Git的 ssh-keygen -t rsa
。
PS: I created these keys using Git's ssh-keygen -t rsa
.
推荐答案
定义一个 .ssh / config文件
,它将引用您的私人
You need to define a .ssh/config file
which will reference your private key.
Host upstream
HostName my_app_name.rhcloud.com
User 1234567890
IdentityFile ~/.ssh/.ssh
然后使用SCP语法设置ssh url:
Then use the SCP syntax for ssh url:
git pull upstream:~/git/app_name.git/
这篇关于Git使用Windows从Openshift中拉出:无效的refspec的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!