I have a master branch and a feature branch. the feature branch gets merged into the master branch with updated code every day or so. However, it does happen often that changes get merged directly into the master branch without going through the feature branch first.
This means that the master branch needs to be merged into the feature branch too. So the master branch contains some updated code and some outdated code and the feature branch contains some updated code and some outdated code.
When trying to merge the master branch into the feature branch sometimes there are cases where the master branch wants to revert changes made on the feature branch, even though the feature branch has the most up to date code.
How can this be prevented?