How to control merge behavior in git
仅有的幸福
仅有的幸福 2017-05-02 09:49:46
0
1
769

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

仅有的幸福
仅有的幸福

reply all(1)
小葫芦

vi .git/hooks/prepare-commit-msg

#!/bin/sh
case "," in
    merge,)
        grep "'A'" ; 
        if [ $? ];then
            echo '禁止合并A merge into B';
            exit 1;
        fi;;
  *) ;;
esac
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template