Git Merge ignores files that were reverted from develop but added on feature branch

Viewed 82

I have 2 branches develop & feature. I did a commit A on develop branch, then I reverted it.

Then I did another commit B on feature branch, which modifies the same file modified then reverted on develop branch.

Now, when I try to create a Pull Request to merge feature branch into develop branch, the files modified in commit B are ignored and do not appear neither as conflict, nor as edited and merged files in my pull request.

Where is the problem ?

1 Answers

As a workaround, you can replay your local feature branch on top of the updated develop branch:

git checkout feature
git fetch
git rebase origin/develop

That way, you are only publishing new commits on top of the latest state of the develop branch.

git push --force
# that will update your existing PR, or make a new one
Related