How can you merge two branches in git, retaining necessary files from a branch?
When merging two branches, if a file was deleted in one branch and not in an
My solution to this was to simply modify the files I needed to keep (added a comment which was needed anyway) and commit those changes on the target branch, thus generating a merge conflict which could easily be resolved with a git add
and a normal commit.
My history went something like this. Branch names have been changed to protect the innocent.
git merge master
on feature_branch causes original files to be removed (of course), git reset --hard
to before the merge