Skip to content

Instantly share code, notes, and snippets.

@sfdcale
Created November 13, 2019 21:29
Show Gist options
  • Select an option

  • Save sfdcale/0c13d3cb33d639c87c7d27ff72ccc8cb to your computer and use it in GitHub Desktop.

Select an option

Save sfdcale/0c13d3cb33d639c87c7d27ff72ccc8cb to your computer and use it in GitHub Desktop.
Script to resolve conflicts during git merge using their strategy
#!/bin/bash
rm -f "out.txt"
git diff --name-only --diff-filter=U > out.txt
while IFS= read -r fileName
do
echo "$fileName"
git checkout --theirs "$fileName"
done < out.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment