Cannot git-clone an OpenShift application

时光总嘲笑我的痴心妄想 提交于 2019-12-05 08:20:16

I got exactly the same issue and found the solution, under windows. It seems you are under Linux, but may be this will give you ideas.

First you need to make sure your SSL keys have been created properly for Git (check this post on my blog for instructions).

Then, using Git for Windows, right click on the folder to clone the project and enter the SSL URL:

Make sure you check Load Putty Key and select the path to your .ppk file. This worked like a charm for me.

May be you need to specify the path to your private key file under Linux when cloning from the command line.

Your mistake is you are clone the repository inside app's host, this goes to clone your repository inside your application host on openshift, then it gives you a permission denied to write access on host, you must close it in your local.

First Open a Command Prompt, then type:

mkdir apprepo
cd /d apprepo
git clone ssh://522c....@mynode-erel.rhcloud.com/~/git/mynode.git/

and if you have any changes in repository:

git commit -a
git push
joshua-anderson

It looks like you are having issues with your ssh key. Have you added one to openshift? You can run rhc sshkey list to check. Make sure that one of these private keys is in your ssh folder, C:\user\\[username]\\.ssh\ for windows and ~/.ssh on linux (Note that on both os's they are hidden folders). Openshift refuses to let you do anything with the git repo unless it can verify your ssh key. Take a look at this Openshift SSH Documentation for more details.

go to preference in eclipse and in ssh key menu, click KEY MANAGEMENT and ther is a rsa key tab click that and copy your public key and click the button save as private key... then go to your open shift application and paste your public key and work on it... i hope it working

Don't use sudo when creating your app or when using rhc

This seems to be the thread for answering SSH key related issues, even if the answer relating to not cloning on the host machine seems to make the most sense.

Regarding the configured keys being good for opening an SSH connection but not for git cloning, I tried everything in this thread and on the OpenShift site and eventually discovered that Git for Windows wasn't using the SSH keys managed by Pageant; the only way for me to clone my repository was to have the Git GUI generate a new key for me and then add that one's public key to my OpenShift application as well.

I'm posting this answer here because I don't know where else I should, I hope it's helpful!

I have the same problem as you, and got an idea based on ʀɣαɳĵ answer

Don't use sudo when creating your app or when using rhc

Considering this recommendation I tried deleting my app and re-creating it using my user without using sudo, but I received some permission errors indicating problems accessing:
- .openshift folder under my user home folder
- .ssh/rsa* documents under my user home folder also
- My actual directory where a new directory would be created as part of the app creation

After granting access to those resources using chmod:
- chmod 755 for both .openshift and .ssh/rsa*
- chmod -R 777 mydir in my actual directory

I re created the app (rhc create app yourAppName platform ) and everything is working fine now!

Hope it helps you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!