Home > Blockchain >  Is there a "git hook" command?
Is there a "git hook" command?

Time:03-11

When trying to run the command:

git p4 submit --shelve

(which runs git-p4.py) I am getting the error:

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 hook run p4-prepare-changelist

but, there doesn't seem to really be a command like git hook! The error message says it all! So what is going on?

CodePudding user response:

To my knowledge git hook run will only be released with Git 2.36 (Q2 2022).

The code mentioned in the comments has been introduced by git/git commit 0c8ac06, which is also for the next Git release.

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

That means you need one matching your git version
For instance:

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

  •  Tags:  
  • git
  • Related