You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

提交推送失败:pre-receive hook拦截,提交信息未找到JIRA Issue

Fixing "No JIRA Issue found in commit message" Push Rejection

Hey there, let's break down why your push is failing and how to fix it quickly.

First, let's recap the error you're seeing (super helpful that you included this!):

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

What's going on here?

Your repository's pre-receive hook (a server-side script that checks pushes before they're accepted) has been updated to require that every commit message includes a valid JIRA issue ID (like OMT-1270). Even though your branch name has the issue ID, the hook is now checking the actual commit messages themselves—something that wasn't enforced when you pushed before.

Step-by-step fix:

  • Update your commit message(s) to include the JIRA issue ID

    • If this is your most recent commit, run:

      git commit --amend
      

      This will open your default editor—modify the commit message to start with OMT-1270: (e.g., OMT-1270: Add missing French translations) and save/close the editor.

    • If you have multiple commits that need updating, use interactive rebase:

      git rebase -i HEAD~2  # Replace "2" with the number of commits you need to edit
      

      In the editor that pops up, change pick to edit for each commit you need to modify. Save and close, then for each commit run git commit --amend to add the JIRA ID, followed by git rebase --continue to move to the next one.

  • Push your updated commits
    Since you've modified commit history, you'll need to force-push—but use the safer --force-with-lease option to avoid overwriting any changes someone else might have pushed to the branch:

    git push --force-with-lease origin feature/OMT-1270-Missing-French-Translations
    

Why did this work before but not now?

It's almost certainly because the repository admins updated the pre-receive hook rules. Previously, the hook might have accepted the issue ID in the branch name, but now it's stricter and requires it in every commit message. This is a common practice to ensure every change is traceable back to a JIRA ticket.

内容的提问来源于stack exchange,提问作者Haq.H

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:24:49