Yesterday, I posted a question on how to clone a Git repository from one of my machines to another, How can I \'git clone\' from another machine?.
I am now
Here is one test you can do to see how the bare
server stuff work:
Imagine you have a workstation and a server with live site hosted on it, and you want to update this site from time to time (this also applies to a situation where two developers are sending their work back and forth through a bare middleman).
Create some directory on your local computer and cd
into it, then execute these commands:
# initialization
git init --bare server/.git
git clone server content
git clone server local
server
directory (notice the .git at the end). This directory will serve as a container for your repository files only.content
directory. This is your live/production directory which will be served by your server software.Now here is the basic workflow:
Enter the local
directory, create some files and commit them. Finally push them to the server:
# create crazy stuff
git commit -av
git push origin master
Now enter the content
directory and update the server's content:
git pull
Repeat 1-2. Here content
may be another developer that can push to the server too, and local
as you may pull from him.