pre-receive hook 被拒绝:在提交消息中没有发现 JIRA 问题?

Haq*_*q.H 7 git jira

我已经提交并试图将更改推送到 repo,但它给了我这个错误。

remote: refs/heads/feature/OMT-1270-Missing-French-Translations: cd54ab15bc8d5764ab12cf6fc202fd9e7d36294b: No JIRA Issue found in commit message.
remote:
To REPONAME
 ! [remote rejected]   feature/OMT-1270-Missing-French-Translations -> feature/OMT-1270-Missing-French-Translations (pre-receive hook declined)
error: failed to push some refs to REPONAME
Run Code Online (Sandbox Code Playgroud)

我以前做过这个,而且效果很好。票也是有效的。为什么它一直抛出这个错误?

回购是bitBucket,原始提交消息是

git commit -m "OMT-1270 Adding missing translations"
Run Code Online (Sandbox Code Playgroud)

Sir*_*dda 11

很少有组织允许 pre-hook 将任何内容提交到存储库。每当您忘记在提交消息中输入 JIRA 编号时,您需要修改提交。

以下是解决步骤:-

1)使用“Git Bash”导航到存储库目录位置

2)然后使用“ git rebase -i”进行变基

3) 它提供了一个页面,显示您以前的提交。

4) 点击i关键字上的“ ”进入编辑模式。

5)无论您要修改哪个提交,将单词从“pick to edit”更改为

6) 单击退出以停止编辑。然后输入“ :wq!”保存退出

7)现在是时候使用“ git commit --amend”一一修改提交了

8) 编辑提交消息,添加您的 jira 编号。

9) 单击Escape 停止编辑。然后输入“ :wq!”保存退出

10) 对提交重复 7,8,9 步骤,您选择了编辑而不是选择。如果您只编辑一个提交,则无需重复。

11) 一劳永逸,做“ git rebase --continue

12)最后做“ git push

# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
Run Code Online (Sandbox Code Playgroud)

  • 9) 单击“Escape”停止编辑。然后输入“`:wq`”保存并退出 (2认同)