Skip to content

Instantly share code, notes, and snippets.

@jp1017
Created April 25, 2016 05:50
Show Gist options
  • Save jp1017/dfcf0c54043746a67791c057208f4180 to your computer and use it in GitHub Desktop.
Save jp1017/dfcf0c54043746a67791c057208f4180 to your computer and use it in GitHub Desktop.
GitHook自动检查版本冲突问题 http://philo.top/2016/04/05/GitHook/
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