简体   繁体   English

有“git hook”命令吗?

[英]Is there a "git hook" command?

When trying to run the command:尝试运行命令时:

git p4 submit --shelve

(which runs git-p4.py ) I am getting the error: (运行git-p4.py )我收到错误:

git: 'hook' is not a git command. See 'git --help'.

When I look in the code for git-p4.py , I see that it's trying to run the command:当我查看git-p4.py的代码时,我看到它正在尝试运行命令:

git hook run p4-prepare-changelist

but, there doesn't seem to really be a command like git hook ?但是,似乎真的没有像git hook这样的命令? The error message says it all!错误消息说明了一切! So what is going on?那么发生了什么?

To my knowledge git hook run will only be released with Git 2.36 (Q2 2022).据我所知git hook run只会随 Git 2.36(2022 年第二季度)一起发布。

The code mentioned in the comments has been introduced by git/git commit 0c8ac06 , which is also for the next Git release.评论中提到的代码已经由git/git commit 0c8ac06 引入,这也是为下一个 Git 版本。

It seems like the only way to get git-p4.py is to copy it from github. The one I have is the latest one from master好像只有从 github 复制来获取 git-p4.py 的方法。我有的是 master 最新的

That means you need one matching your git version这意味着您需要一个与您的git version匹配的
For instance:例如:

https://github.com/git/git/blob/v2.35.1/git-p4.py https://github.com/git/git/blob/v2.35.1/git-p4.py

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

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