I have an app hosted on OpenShift, which allows deploying apps by adding it as a Git remote and pushing changes to it.
I have added some code that breaks the server startup, so I would like to rollback to a previous commit. To do this I attempted to push the commit to the remote repo with:
git push openShiftRemote 6f0c6aa5d397e2ac46f34e533d2e33e3d7dde625:master
Git rejects this, responding with this message: Updates were rejected because a pushed branch tip is behind its remote
It sounds like I should be able to make it work by including the -f
flag to force the push. I have a separate remote that exists for pulling, etc. The OpenShift remote exists entirely for deployment, so I don't think using -f would break anything.
Is this safe? And more importantly, is this the best way to accomplish this?