Mo J. Mughrabi
Mo J. Mughrabi

Reputation: 6997

revert the git last commit and apply it to github for deployment scripts

We made a commit recently which we need to revert. We were able to successfully revert this change and apply it to GitHub doing the following

git reset --hard HEAD~1
git push -f

The problem is, our deployment script is rejecting the changes. The way our deployment scripts work is, they pull from the development branch and merge it with the staging branch to reflect new changes following these steps

git checkout development
git pull
git checkout staging
git pull
git merge development # it is refusing to merge at this stage 
git push

Can anyone help on how we can revert the last commit and make it reachable for our deployment scripts?

Upvotes: 1

Views: 660

Answers (1)

Attila Szeremi
Attila Szeremi

Reputation: 5488

You can't merge with an ancestor of a commit. Either you are going to need to do a git revert and make a new commit, reverting the changes, or override the behavior of your deployment scripts somehow.

Upvotes: 1

Related Questions