0

I have a feature branch where I made some changes there and push it to the upstream. And after that I checkout to master branch and merged feature branch and pushed to upstream master branch.

Another developer remove my changes from master branch and pushed it to the upstream master branch.

After this I again merge my feature branch to master branch which result it also remove my code from the feature branch.

Is there any option to keep the changes in source branch while merging with master branch where the code changes is not available ?

AMit SiNgh
  • 325
  • 4
  • 17
  • 1
    You can avoid this entire problem by adopting a PR-based workflow. In other words, don't have individual developers able to push to master. – Oliver Charlesworth Aug 26 '16 at 10:50
  • 1
    You could try to force the merge to keep all your changes, but then you might be throwing out someone else's work. And you already know that a simple merge will discard your work. Really, the only safe way out of this AFAIK would be to force Git to pause at all merge conflicts, which you can then resolve by hand. See here: http://stackoverflow.com/questions/5074452/git-how-to-force-merge-conflict-and-manual-merge-on-selected-file – Tim Biegeleisen Aug 26 '16 at 10:54

0 Answers0