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:
- master
- develop
- feature/one
- feature/two
- release/one
- release/two
- etc
The simplified work flow is as follows:
- make changes in
develop
- push develop to backup server
- checkout to
master
- merge
master
with develop` - push
master
to live server
What I want to achieve, is that when I push master
branch to live server, I should be able to instantly see changes when accessing website by URL.
The problem is that I can't really push master
, because it is checked out on live server.
Can I write a pre-push hook which will do a checkout to dummy
branch on remote, and a post-push hook which will do a checkout back to master
? The point is that these hooks involves execution of git commands on remote and I'm not sure how to do this.
Would appreciate any examples very much!