I am trying to create a Local -> Development -> Production environment with the help of Git(hub). But I cannot find the right way to do this.
These are the levels:
- Local development repository with a master, develop and feature branches.
- Github repository with master, develop and feature branches.
- Test remote server https://test.website.com/
- Production server https://website.com/
This is the workflow I have in mind:
1) I make my changes locally, first in feature branches.
2) Merge feature branch with develop branch.
3) Push to Github repository.
4) Pull the develop branch to my test remote server. Test if everything is ok.
// Development server
ssh username@[IP_ADDRESS]
cd /to/my/git/folder
git pull https://www.github.com/user/repo
5) Merge my develop branch into master.
6) Pull my master branch on my production remote server.
// Production server
ssh username@[IP_ADDRESS]
cd /to/my/git/folder
git pull https://www.github.com/user/repo
The Problem
The problem I am facing is that when I git pull my repo on the development server I only get my master branch. But I want my develop branch on my development server and my master branch on my production server.
Is this even an efficient workflow or do I need to design it another way?