Assume that there are two branches A and B in the git library. How to set it to achieve the following effect:
Allow B merge into A, and vice versa
高洛峰2017-05-02 09:51:46
vi .git/hooks/prepare-commit-msg
#!/bin/sh
case "," in
merge,)
grep "'A'" ;
if [ $? ];then
echo '禁止合并A merge into B';
exit 1;
fi;;
*) ;;
esac