3

So I have my local repository, and I have an earlier commit which I want to revert my production site to. I can check it out and make it a branch and push it to openshift. The branch then shows in openshift but when I try to checkout the branch in openshift, I get this error:

[appdev-deltaskelta.rhcloud.com appdev.git]\> git checkout old-state
fatal: This operation must be run in a work tree

So I can revert my local repo to the point that I want, but how can I get openshift to use the commit that I wnat to revert to. I hope I explained this well, I am not sure how else to say it.

timo.rieber
  • 3,727
  • 3
  • 32
  • 47
Joff
  • 11,247
  • 16
  • 60
  • 103

2 Answers2

2

There is a native solution builtin. With the rhc app-configure command, you can list the current branch which is used for deployment:

rhc app-configure

To change the branch to deploy from issue the following command:

rhc app-configure --deployment-branch <your_branch>

More details can be found at Introduction to Deployments and Rollbacks on OpenShift.

timo.rieber
  • 3,727
  • 3
  • 32
  • 47
1

It looks like you run this command inside the .git directory, which isn't actually tracked, but contains only the git (meta)data

afaik OpenShift builds only the master branch. The easiest solution to this problem would be to get your local repo to the state where your desired version will be in the master branch and then do

git push -f

Community
  • 1
  • 1
Jiri Kremser
  • 12,471
  • 7
  • 45
  • 72