git - 预接收钩拒绝 : No JIRA Issue found in commit message?

标签 git jira

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

最佳答案

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

以下是解决步骤:-

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

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

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

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

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

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

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

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

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

关于git - 预接收钩拒绝 : No JIRA Issue found in commit message?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49943924/

相关文章:

git - 如何清理远程 GIT 存储库?

java - Jira 弹出消息

java - Jira小工具开发

docker - 如何访问Docker镜像中的JIRA Software文件?

agile - 企业敏捷开发环境中 Jira 的替代方案

git - 如何以透明的方式从另一个 git 分支获取目录的副本?

git - 推送后自动 checkout

git - 使用 Git merge 问题

git - 将远程分支重置为之前的提交

jira - 在敏捷 Jira(Greenhopper) 中开始冲刺时将故事点设为必需/强制