As the title states, I want to figure out a workflow to test my GIT Branches on a Live server before merging to master and pushing to production.
This is my current GIT Workflow:
I should note on my server the repo's are in /var/repo/dev.git and /var/repo/site.git and sync to my /var/www/(dev & site folder)
Here is the folder structure:

Inside dev.git and site.git
#HEAD
ref: refs/heads/master
---------
#CONFIG:
[core]
repositoryformatversion = 0
filemode = true
bare = true
Inside the folder refs there is a folder called heads and a file called master. There are also other files that are named the same name as my branches I've tried to push.

For simple changes:
- I work directly on the Master Branch, Locally.
- Then Push to a Live Staging server
dev.example.com to make sure
everything is running smooth
- Then push the master to the Live Production server
example.com
git status
git add *
git commit -m "My Change"
git push // Pushes to Master Branch on Git Hub
git push staging // Pushes to my live staging server
git push production // Pushes to my live production server
For Branches:
-
I create a new branch locally git checkout -b newbranch.
-
Then Push to newly created branch on GitHub git push origin newbranch
-
When on the newbrach I push to GitHub then try and push to git push staging or git push staging newbranch, but no changes are made to my staging/dev server
-
So I have to git everything working on that branch locally
-
Merge to the Master Branch
-
Then push to Staging and hope all is working smoothly
-
The push to Production
I want to figure out how to Push my working branch to my Live staging
server so I can run Live Tests. Then Merge to Master and Push to
Production.
Here is a nice little diagram of what I'm currently doing and what I want to do.
Note, I want to do illustration #3 in the diagram.
