How do you merge the commit that was returned?

I recently came across a situation where I merged changes from a function branch into my main branch and production branch. Then I needed to remove the changes from my production branch, so I used git revert . Now I need to merge these changes back into the production branch, but if I run git merge sha1, I get the message:

Already up-to-date

Can anyone help me with this?

UPDATE Thus, I ended up creating a branch of my production branch, applying diff from the files that I returned to this branch, and then changed this change to production. I don't like it, but it worked. I would still be interested to hear if there is a way to use the same sha1.

+4
source share
1 answer

Now I need to merge these changes back into the production branch

git revert , if done in the production branch, would create a new commit whose undo you want to remove.

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

If you meant โ€œmerge back into the feature branchโ€, then the merge you apply should be committed to the feature branch, also removing the changes from the feature branch.

0
source

Source: https://habr.com/ru/post/1444394/


All Articles