Question

I recently had a situation where I merged changes from a feature branch into my master branch and production branch. I then needed to remove the changes from my production branch so I used git revert. I now need to merge those changes back into the production branch, but if I perform a git merge sha1 I receive the message:

Already up-to-date

Can anyone help me with this?

UPDATE So I wound up creating a branch off of my production branch, applying a diff from the files that I had reverted in that branch and then merging that change into production. I don't like it, but it worked. I would still be interested in hearing if there is a way to use the same sha1.

Était-ce utile?

La solution

I now need to merge those changes back into the production branch

git revert, if done on the production branch, would have created a new commit canceling the one you wanted to remove.

Since that new commit is already on that branch ('production'), you cannot merge it.

If you meant "merge back to feature branch", then the merge you apply that new commit on the feature branch, removing the changes from the feature branch as well.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top