In our git workflow (using GitHub Enterprise) we have feature branches that have to be merged into two different and independent branches (dev and master). That works well as long as there is no merge conflict.
For example, two feature branches merged into dev have conflicting changes for file F. Both changes should end up in dev, but I don't want dozens of unrelated changes from dev getting merged into my feature branch because they would end up later in master and that's not okay.
What we tried:
- GitHub's editor lets you fix the issue easily but at the same time it also quietly merges the target branch (dev) into the source (the feature branch). I haven't found a way to stop it from doing so.
- There seems to be no way to use
git merge
on a single file. git checkout dev --patch -- F
gives you a horrible interface based on vim which I don't dare to propose to my team.- There's also a
--merge
option ingit checkout
which simply seems to overwrite changes. git checkout --conflict=diff3
had exactly the same result.
The best we came up with so far was to do the changes in GitHub and to revert the merge in the feature branch afterwards but that doesn't look like a clean and solid solution to me.