I am writing a bash script to do some automation. Part of the script involves navigating to a local repo, switching to the local master branch, then pulling the remote master to
Based on the answer given by torek, here is a ready-to-use snippet:
CONFLICTS=$(git ls-files -u | wc -l) if [ "$CONFLICTS" -gt 0 ] ; then echo "There is a merge conflict. Aborting" git merge --abort exit 1 fi