Force git to run post-receive hook, even if everything is “up-to-date”

后端 未结 9 1765
再見小時候
再見小時候 2020-11-30 19:27

How do I force git to run a post-receive hook on a server even if I don\'t have a new commit to push?

Background

I use git to aut

9条回答
  •  情深已故
    2020-11-30 19:39

    I made a bash function to do this. It assumes that you have ssh access can ~/.ssh/config set accordingly. The default remote is origin

    kick-git() {
        remote="${1:-origin}"
        ssh $(echo $(git remote get-url "$remote")/hooks/post-receive | tr ':' ' ')
    }
    

    Source and run kick-git [remote]

提交回复
热议问题