I'm on branch feature and rebasing onto master and histories have diverged. In feature dozens of files have been deleted that have at the same time been modified on master. I'm sure I don't need these files anymore, so rebase, keeping what's on feature:
git rebase -Xtheirs master
It accepts all the changes I did on feature but still leaves conflicts for modified files from master that have been deleted on feature, reporting:
CONFLICT (modify/delete): some/file1 deleted in HEAD~3 and modified in master. Version master of some/file1 left in tree.
And
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add/rm <file>..." as appropriate to mark resolution)
deleted by them: some/path/file1
deleted by them: other/path/file2
deleted by them: another/path/file3
...
And there's a gazillion of them. I have to run git rm some/path/file1
for each of them. Is there an easy way to list all the deleted by them files and pass them to git rm
automagically?
Update: If you want to try it out, here's a very small sample GitHub repo with that situation. Clone and checkout feature, then try to rebase onto master.
git clone https://github.com/chhh/git-rebase-conflict-resolution
git checkout feature
git rebase -Xtheirs master