사용자 도구

사이트 도구


git:gitlab

문서의 이전 판입니다!


Gitlab

gitlab-cli

Disable Force Push

#!/bin/sh
# <oldrev> <newrev> <refname>
# update a blame tree
 
while read oldrev newrev ref ; do
    # old revision is blank - branch creation
    if [ "$oldrev" = "0000000000000000000000000000000000000000" ] || 
         # new revision is blank - branch deletion
         [ "$newrev" = "0000000000000000000000000000000000000000" ] ;
    then
        # create new or delete old branch
        continue;
    fi
 
    base=$(git merge-base $oldrev $newrev);
    if [ "$base" != "$oldrev" ] ; then
        # non fast forward merge
        echo "Force pushing of $ref is forbidden";
        exit 1;
    fi
done
exit 0;

참조

git/gitlab.1657181900.txt.gz · 마지막으로 수정됨: 2022/07/07 17:18 저자 kwon37xi