【问题标题】:pre-receive hook declined: No JIRA Issue found in commit message?预接收挂钩被拒绝:在提交消息中未发现 JIRA 问题?
【发布时间】:2020-03-18 04:21:21
【问题描述】:

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

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

repo 是 bitBucket,原始提交消息是

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

【问题讨论】:

  • “repo”大概是你的办公室设置的东西,我们需要更多更多背景信息来提供帮助。就像哪个系统实际上拒绝了您的预接收挂钩、BitBucket、BitBucket Server(又名 Stash)、GitLab?这就是实际问题所在。
  • 我想说,我们可能还需要查看提交消息。
  • 是的,您没有偶然将“分支名称”与“提交消息”混淆,或者您的消息中有错误的分支名称?如果这是你的问题,this will answer the next question you're about to ask
  • 啊,我为含糊不清道歉,我将编辑原始问题!另外,我认为问题不在于 BItBucket,而在于我的本地克隆。我克隆了另一个实例,我可以从那个实例中很好地推送。
  • @Haq.H 作为旁注,要自动化一些在提交消息前添加问题编号/分支名称的过程,您可以依赖hooks

标签: git jira


【解决方案1】:

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

以下是解决的步骤:-

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

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

3) 它给出一个页面 显示您以前的提交。

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

5) 无论您要修改哪个提交,将单词从 “选择编辑”

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

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

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

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

【讨论】:

  • 9) 单击 Escape 停止编辑。然后输入“:wq”保存退出
  • 这就是方向的书写方式。在这个问题上最清楚的。谢谢。
猜你喜欢
  • 2012-01-03
  • 1970-01-01
  • 2020-07-19
  • 2012-03-21
  • 1970-01-01
  • 2020-03-12
  • 2015-04-03
  • 2018-06-18
  • 1970-01-01
相关资源
最近更新 更多