我正在为此仓库使用GitLab,并且我已经从中更改了我的预提交文件:
if [ "$FILES" != "" ]
then
echo "Running Code Sniffer..."
./vendor/bin/phpcs --standard=PSR2 --encoding=utf-8 -n -p $FILES
if [ $? != 0 ]
then
echo "Fix the error before commit."
exit 1
fi
fi
对此:
if [ "$FILES" != "" ]
then
echo "Convert files from DOS to UNIX standart";
php ./dos2unix.php $FILES
fi
if [ "$FILES" != "" ]
then
echo "Running Code Sniffer..."
./vendor/bin/phpcs --standard=PSR2 --encoding=utf-8 -n -p $FILES
if [ $? != 0 ]
then
echo "Fix the error before commit."
exit 1
fi
fi
但是每次我从另一个分支合并或创建新分支时,新代码都会消失。
如何提交此更改,以便任何新分支具有相同的预提交文件?