How can I prevent deleting deleted files when I merge a branch on Git

I have a "develop_refactor" branch based on a "develop" branch. In "develop_refactor" I deleted some file in "develop_refactor". Sometimes I merge from "develop" to "develop_refactor" to update the newest code from "develop". But the deleted file comes back. I have to delete again. How can I prevent it from being returned?

Update

enter image description here

+3


source to share


2 answers


For this reason, the correct way to keep the updated branch is by reloading.

$ git rebase develop



This will replay all make_refactor decompositions on top of new commits, thereby ensuring that the file is deleted every time.

+2


source


The deleted file will appear when there is a conflict with a file on the server. You delete it, but some modify it on the server. So git detects this as a conflict. And it is restored again for you. If you don't want this file, just delete it.



Unless the remote file is modified by another person, it won't reappear when you merged with the developer into a child branch.

0


source







All Articles