I’ve checked out an orphan branch and am applying it to a branch with an unrelated history. This works great except for one scenario–deletions. If the source branch deletes a tracked file, the deletion does not carry over to the target branch when I apply the orphan branch.
git switch sourceBranch git checkout --orphan orphanBranch git rebase -X theirs otherRemote/targetBranch
As I said, this works fine until a tracked file is deleted from
sourceBranch. The deletion doesn’t get applied to
targetBranch. Is there a way to have files that are missing from a snapshot be deleted?
(note: I’m rebasing to avoid the merge commit. Since these are unrelated histories, it won’t ever FF.)
Leave an answer