Created
November 2, 2014 09:36
-
-
Save nabe256/3a927ee6da681ef3cc5a to your computer and use it in GitHub Desktop.
git bare repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /var/git | |
(a) | |
$ git clone --bare /var/www/html/project project.git | |
(b) | |
$ mkdir project.git ; sudo chown -R user:user project.git | |
$ cd project.git ; git init --bare | |
$ cd /var/www/html/project ; git push /var/git/project.git master | |
$ cd /var/git/project.git | |
$ vi hooks/post-receive | |
#!/bin/sh | |
git --work-tree=/var/www/html/test --git-dir=/var/www/html/test/.git pull /var/git/test.git | |
$ chmod +x hooks/post-receive | |
client$ git clone server:/var/git/project.git project | |
client$ git clone ssh://server/var/git/test.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment