Not able to detect branch from Git post-receive hook

前端 未结 5 1534
面向向阳花
面向向阳花 2021-01-31 11:37

I\'ve got a post receive hook setup on the remote repo that tries to determine the branch name of the incoming push as follows:

$branch = `git rev-parse --abbrev         


        
5条回答
  •  不知归路
    2021-01-31 12:05

    You need to read the arguments that are being passed to the script. That should have the branch name and new and old revisions and run for each branch pushed

提交回复
热议问题