If i've understood your issue properly here is what the git log should looks like :
* ff3f8a1 (HEAD -> master) changed text
| * 8a4d7d7 (dev) removed file
|/
* 615d151 initial commit
If you do git merge dev
to merge branch dev
onto master
, you will end up with a merge conflict. That's why the file came back. You have to resolve that conflict manualy by either:
- removing the file (
git rm --force <file>
)
- getting the remote version (on the deleted side) of it (
git checkout --theirs <file>
)
git merge --strategy-option=theirs
won't be able handle those kind of conflicts (modify/delete)
AFAIK there is no proper way arround that without manual conflict resolution, but there are some hacky solutions like this one wich deletes all the files that fail to merge (can be dangerous): https://stackoverflow.com/a/54232519/8541886
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…