vi .git/hooks/pre-commit

#!/bin/bash

function color() {
    scheme=$1
    shift
    echo -e "\e[${scheme}m"$*"\e[0m"
}

rebasing=`git status | grep 'currently rebasing'`
if [ ! -z "$rebasing" ]; then
        color '31;43' "currently rebasing, commit not allowed"
        echo
        exit 1
fi




欢迎扫码关注:




转载请注明出自 ,如是转载文则注明原出处,谢谢:)
RSS订阅地址: https://www.felix021.com/blog/feed.php