johsya
Last Updated: September 12, 2016
·
41
· DamonOehlman

Unstage all merge conflicted files on a rebase operation

git

Occasionally when you are working on a number of different feature branches at the same time, you can get collisions that you would prefer to just git rebase --skip, however, that particular commit also includes useful changes to other files. To get around this, you might find yourself manually doing a whole pile of git reset HEAD filename. I'd recommend considering the following instead (assuming you genuinely don't want the changes), i.e. USE WITH CARE

git diff --name-status --diff-filter=U | cut -f2 | xargs git reset HEAD
git diff --name-status --diff-filter=M | cut -f2 | xargs git checkout --