簡體   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