#initial directory setup
mkdir master-repo
mkdir dev-repo
mkdir running-instance1
mkdir running-instance2
#bare repositories can be cloned, pushed too and store extra metadata
cd master-repo
git init --bare
cd ..
# checkout the first bare repo
cd dev-repo
git clone ../master-repo
cd ..
# Let's create a simple hook:
#In your bare repo in the hooks directory put these lines in a file named "post-recieve"
#After that make the file executable
#!/bin/sh
git --work-tree=<absolute path to master repo> --git-dir=<absolute path to repo> checkout -f
git --work-tree=<absolute path to master repo> --git-dir=<absolute path to repo> checkout -f