Last active
December 10, 2015 14:58
-
-
Save eduardo-matos/4451501 to your computer and use it in GitHub Desktop.
Verificar se existe conflito antes do commit (GIT)
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
#!/bin/sh | |
conflitos=`git diff --staged --pretty="format:" --name-only -S"<<<<<<< HEAD"`; | |
if [[ $conflitos != '' ]]; then | |
echo ""; | |
echo ""; | |
echo "Existem conflitos a serem resolvidos nos seguintes arquivos:"; | |
# texto preto, background vermelho | |
echo -e "\E[30;41m"; | |
echo $conflitos; | |
# texto branco, background preto (padrão) | |
echo -e "\E[37;40m"; | |
echo "Resolva-os e tente comitar novamente."; | |
exit -1; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment