我找到了一个问题的答案.如果它可以帮助某人......
我刚创建了一个包含的commit-msg文件.git/hooks
#!/bin/sh
test -n "$(grep 'app.asana.com/' ${1})" || {
echo >&2 "ERROR: Commit message is missing Asana's task link.\n\nPlease append the Asana's task link relative to this commit into the commit message."
exit 1
}
Run Code Online (Sandbox Code Playgroud)
每个用户都需要有一个commit-msg文件.git/hooks.然后,作为一个解决方案,我添加commit-msg到项目文件夹(所以我可以拉这个)与另一个名为commit-msg-hook.sh包含的文件:
#!/bin/sh
cp commit-msg .git/hooks/commit-msg
chmod +x .git/hooks/commit-msg
echo "\nThe commit-msg hook was added to git hooks"
Run Code Online (Sandbox Code Playgroud)
我欢迎任何建议,以改善我所做的.谢谢.