Chris Mendez in Openshift, Git

Git: Save to both Github and Openshift

I have an app on Redhat Openshift but I want to save a backup on Github or Bitbucket. Here's how:

Step 1 - Create a remote git-url

You can create a remote git url by adding remote.

git remote add openshift ssh://my-repository.rhcloud.com/~/git/api.git/  

Step 2 - Update a remote git-url

git remote set-url openshift ssh://my-repository.rhcloud.com/~/git/api.git/  

Step 3 - Upload to git

Do everything simlar to a normal git repo.

git add -A  
git commit -m 'my commit message'  
git push  

git remote add origin  

Push to the origin and master

git push -u origin master  

Push all

git push -u origin --all