Reputation: 3807
I would like to setup git for a website taking the following into account:
I have a VPS setup where I plan on doing the following:
I would like to see the following happen:
What is the best approach to have something like this work.
I just now started to use GIT and it is getting a little confused.
Upvotes: 0
Views: 505
Reputation: 18467
Assuming you are using a central repo for your code (github, gitlab ect..)
Create two branches in git (master & dev)
Always checkout the dev branch for your work. (Never master)
windowsComupter$ git checkout dev
When you are happy with the results, upload your commit
windowsComputer$ git commit
windowsComputer$ git push
On your development site, pull down the latest dev repo
dev-site$ git pull origin dev
When you have tested everything, merge dev into master
windowsComputer$ git checkout master
windowsComputer$ git merge dev
Go to your production site, and checkout the latest master
productionServer$ git pull origin master
Let me know if that doesn't answer your question and I'll expound further.
Upvotes: 1