使用git钩子在“git push”finalize之后执行命令
我试图在git push完成后运行一个命令,但它没有运行使用git钩子在“git push”finalize之后执行命令,git,hook,Git,Hook,我试图在git push完成后运行一个命令,但它没有运行 我尝试使用post receive、post update和pre push 与预推一起工作 一些信息: git版本2.17.1 路径文件:testProject/.git/hooks/ Ubuntu 18.04.3 LTS 代码示例: #!/bin/sh # # An example hook script to prepare a packed repository for use over # dumb transports. #
我尝试使用
post receive
、post update
和pre push
与预推一起工作 一些信息:
git版本2.17.1
路径文件:testProject/.git/hooks/
Ubuntu 18.04.3 LTS
代码示例:
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".
echo "test" > /home/Darck/Desktop/testProject/test.txt
# exec git update-server-info
是,因此如果您在本地(在推送的位置)定义了它们,它们无论如何都不会运行
应该在myrepo/.git/hooks/pre-push