Last active
March 8, 2024 17:31
-
-
Save joekrump/68e597cca464701b4907fe360a1e7876 to your computer and use it in GitHub Desktop.
Quick resolve multiple files with conflicts when you know if you want "ours" or "theirs" for the resolution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Helpful for when running git rebase -i and selecting multiple files to fixup or drop | |
# select ours for each conflict | |
git status | grep both | awk '{print $3}' | xargs git checkout --ours | |
# select theirs for each conflict | |
git status | grep both | awk '{print $3}' | xargs git checkout --theirs | |
# run with && git add . && git rebase --continue to add and move on | |
git status | grep both | awk '{print $3}' | xargs git checkout --ours && git add . && git rebase --continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment