提交推送失败:pre-receive hook拦截,提交信息未找到JIRA Issue
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 --amendThis 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 editIn the editor that pops up, change
picktoeditfor each commit you need to modify. Save and close, then for each commit rungit commit --amendto add the JIRA ID, followed bygit rebase --continueto 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-leaseoption 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

