Forked from maxmarkus/pre-commit-hook-merge-conflicts.sh
Created
June 10, 2022 14:53
-
-
Save MakowskiHubert/d3485289707b1da0eb8ef0627a5aba31 to your computer and use it in GitHub Desktop.
Revisions
-
maxmarkus revised this gist
Mar 24, 2016 . 1 changed file with 2 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,16 +4,9 @@ # Tested on Linux and Mac # Simple check for merge conflics conflicts=`git diff --cached --name-only -G"<<<<<|=====|>>>>>"` # Something went wrong if [[ -n "$conflicts" ]]; then -
maxmarkus created this gist
Mar 24, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ #!/bin/bash # Check for merge conflicts # Tested on Linux and Mac # CONFIG # Give options empty values to bypass checks ("OPTIONNAME=") # whether to check ig git merge conflicts have been added CONFLICTS=1 # Simple check for merge conflics if [[ -n $CONFLICTS ]]; then conflicts=`git diff --cached --name-only -G"<<<<<|=====|>>>>>"` fi # Something went wrong if [[ -n "$conflicts" ]]; then echo echo "Unresolved merge conflicts in these files:" for conflict in $conflicts; do echo $conflict done; exit 1; fi exit 0