繁体   English   中英

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

[英]pre-receive hook declined: No JIRA Issue found in commit message?

我已经提交并试图将更改推送到 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

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

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

git commit -m "OMT-1270 Adding missing translations"

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

以下是解决步骤:-

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

2)然后使用“ git rebase -i ”进行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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM