简体   繁体   English

Git post-receive-email :(提交)的未知类型

[英]Git post-receive-email: Unknown type of (commit)

I'm having an issue with Git's post-receive-email hook script. 我对Git的post-receive-email钩子脚本有问题。 Here is what I did: 这是我所做的:

  1. On my server, I initialized a bare repository using: git --bare init myrepo.git . 在服务器上,我使用git --bare init myrepo.git初始化了裸存储库。 My server's Git config file says core.bare = true 我服务器的Git配置文件显示core.bare = true
  2. Did the setup using the guides for Git email for post receive 是否使用收到的Git电子邮件指南进行设置
  3. On my client, clones the repository using git clone URL . 在我的客户端上,使用git clone URL克隆存储库。 On my client, Git config is core.bare = false . 在我的客户端上,Git配置为core.bare = false
  4. Did some work, added the new files, committed to the local Git 做一些工作,添加新文件,提交给本地Git
  5. Pushed the changes to the remote repository using: git push origin master which issues the generated ref-ids for the commits done 使用以下命令将更改推送到远程存储库: git push origin master发出完成的提交的生成的ref-id
  6. But I do not receive emails; 但是我没有收到电子邮件。 so tried to run the post-receive hook script on the server in hooks directory with ./post-receive <oldrev> <newrev> refs/heads/master 因此尝试使用./post-receive <oldrev> <newrev> refs/heads/masterhooks目录中的服务器上运行后接收钩子脚本

The following error is constantly returned: 不断返回以下错误:

Unknown type of update to c9c047af (commit) 对c9c047af的未知更新类型(落实)
no email generated 没有生成电子邮件

Any clues what could be wrong? 有什么线索可能是错误的吗?

Although I used a distribution post-receive-email script, I found a strange bug in the script. 尽管我使用了分发post-receive-email脚本,但在脚本中发现了一个奇怪的错误。 Towards the end of post-receive-email in my version said: 在我的版本中, post-receive-email的结尾说:

prep_for_email $2 $3 $1 && PAGER= generate_email

which should be 应该是

prep_for_email $1 $2 $3 && PAGER= generate_email

The change resolved my manual call to post-receive <oldrev> <newrev> <refname> . post-receive <oldrev> <newrev> <refname>的更改使我手动调用post-receive <oldrev> <newrev> <refname> I hope this helps others that may face it. 我希望这对其他可能遇到的问题有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM