更新时间:2021-07-01 04:51:31
您可能需要设置 prepare-commit-msg
在您的本地存储库上。它可能看起来像这样(比如分支机构被命名为'work-on-ticket-XXXX'):
$ b
You probably want to set up a prepare-commit-msg
hook on your local repository. It might look like this (say the branches are named 'work-on-ticket-XXXX':
#!/bin/sh
ORIG_MSG_FILE="$1"
TEMP=`mktemp /tmp/git-XXXXX`
TICKETNO=`git branch | grep '^\*' | cut -b3-`
(echo "Work on ticket #$TICKETNO"; cat "$ORIG_MSG_FILE") > "$TEMP"
cat "$TEMP" > "$ORIG_MSG_FILE"
在 .git / hooks / prepare-commit -msg
。当然,您可能需要进行调整和详细说明。
Put something like that (marked executable) in .git/hooks/prepare-commit-msg
. You may have to adjust and elaborate on it of course.