Created
April 25, 2016 05:50
-
-
Save jp1017/dfcf0c54043746a67791c057208f4180 to your computer and use it in GitHub Desktop.
GitHook自动检查版本冲突问题 http://philo.top/2016/04/05/GitHook/
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
echo BEFORE COMMIT | |
ex=$(git remote -v | awk '{printf "%s\n",$1}' | grep wothing | wc -l) | |
if [[ $ex == 0 ]];then | |
git remote add wothing https://github.com/XXXXX/XXXX.git | |
fi | |
git fetch wothing | |
echo -e "UR \033[32m ahead $(git rev-list --left-only develop...wothing/develop | wc -l) \033[0m commits before" | |
echo -e "UR \033[31m behind $(git rev-list --right-only develop...wothing/develop | wc -l) \033[0m commits after" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment