Hi Carey, welcome to the wonderful world of Git ;)
So, you've got some server machines:
* UK machine
* US machine
* local machine
You've got basically one repo called "website". This repository will get
cloned across each of these three machines.
Now don't confuse these repositories with the directories where you actually
host your files, that's probably somewhere in /srv/website/main or
Now, since I guess people are not going to be actively working the code on
the US machine or the UK machine, these two can be *bare* repositories.
The repo on your local machine is where you do some work, so this can't be
bare, naturally (bare means there's no working-tree in the repo).
Now the branches. Sounds like you've got two "version" of your website:
1) The live version, let's call this "master"
2) The stage version, let's call this "stage"
Now you can work on both of these versions locally. When you're happy with
some changes in the stage branch, you want to commit them, push the changes
to your UK server, and then deploy them on in the stage directory:
0) git checkout stage, make some changes
1) git commit -am "Some changes"
2) git push uk stage (where uk is a remote with the name "uk")
Now, ssh to your uk server, or somehow execute this remotely:
#> deploy-website stage
.. where deploy-website is a shell script that takes a branch parameter, and
as a result copies the contents of this branch out into
/srv/website/[branch]). For more info on how to copy out the contents, have
a look at git
So, now you're happy with how the stuff looks on the UK stage website, so
you decide to merge the change in to bring it live. Back on your local
3) git checkout master
4) git merge stage (merges the latest changes from stage branch onto your
5) git push uk
And ssh to your uk server again, and execute:
#> deploy-website master
I know some people like just deploying files by just doing another clone of
the repository, but I'll leave that technicality up to you :)
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at