首页 > 解决方案 > git push 错误“错误:提交消息必须包含工作项 ID”

问题描述

当我推送我的仓库时,我在下面收到错误消息,我的同事可以正常推送。我怎样才能解决这个问题?谢谢!

$ git add .
$ git commit -am "add files"

$ git push 
Counting objects: 43, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (38/38), done.
Writing objects: 100% (43/43), 6.80 MiB | 17.28 MiB/s, done.
Total 43 (delta 10), reused 0 (delta 0)
remote: 
remote: 
remote: **********************************************************************
remote: *  Error: Commit message must contain a workItem ID(for example, EL-
remote: *    91), to which commit will be linked!
remote: *  Commit interrupted.
remote: **********************************************************************
remote: 
remote: Commit Aborted!
To http://10.99.1.1/name/name/name.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://10.99.1.1/name/name/name.git'

标签: gitpush

解决方案


所有以开头的行都remote:来自安装在另一端的某种定制软件,而不是来自 Git。

remote:从每一行中取出单词并阅读信息。如果它告诉您如何解决问题,请按照说明进行操作。如果它没有告诉您如何解决问题,请向生成这些文本行的人投诉。Git 本身无法帮助您,因为问题与 Git 无关。

在这种情况下,消息对我来说似乎相当清楚:他们(无论他们是谁)都有 Git 提交消息的必需格式,而您编写的 Git 提交消息不符合要求的格式。使用git rebase -igit commit --amend修改您的提交消息以使其符合所需的形式。


推荐阅读