DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

New Git Repo

06.28.2008
| 2346 views |
  • submit to reddit
        // setup new git repo

cd ~/repo/
git clone –bare ~/projects/myprojectname myprojectname.git
touch myprojectname.git/git-daemon-export-ok
cd myprojectname.git
git –bare update-server-info
# post-update executes everytime there is a push to this public repository;
# it executes an update-server-info by default.
chmod a+x hooks/post-update

cd ~
rsync -av ~/repo username@webhost.example.com:~/git/