Pre-push and post-push hooks involving remote checkout

后端 未结 1 1567
时光说笑
时光说笑 2020-12-11 12:06

I have a remote repository for a website which I am developing on my local machine.

I use git flow for neat branching model, so my branches are:

相关标签:
1条回答
  • 2020-12-11 12:42

    You should push to master on a bare repo.

    Then a post-receive hook can checkout that bare rpeo on your live server.

    cd /path/to/bare/repo.git
    GIT_WORK_TREE=/path/to/live/server git checkout -f
    
    0 讨论(0)
提交回复
热议问题