Question

We have a repository and it only has one branch: master.

My friend and I git clone on master in our local machines. Whenever we have changes we git commit & git push on master and git pull for update.

Now, we bought a VPS to serve as our staging (and will be production later on) and we also setup a subdomain on our domain:

http://dev.domain.com/ => /var/www/project_dev

http://domain.com/ => /var/www/project_prod

Now I am confused what should I do to have a git copy on both directories. Should I create a development branch and we push our local changes there and that is where /var/www/project_dev will clone? Then the master branch is where I should clone the /var/www/project_prod? Can you please enlighten me.

Was it helpful?

Solution

I like using this workflow.

Git branching model

Basically, you normally commit to develop branch. Merges into master indicate stable releases. So whenever you merge into master, have a hook pulling from the master branch on the staging repo to the master branch on the production repo.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top