Dec 3

git pre-commit hook 不指定

felix021 @ 2025-12-3 21:06 [IT » 软件] 评论(0) , 引用(0) , 阅读(98) | Via 本站原创 | |
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
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   *非必须
网址   电邮   [注册]