How to configure configure git when there are multiples sites running in a droplet?

Posted March 19, 2013 3.7k views
I've followed the git tutorials and the multiple-sites-in-1-droplet tutorial from DigitalOCean and now my sites are in var/www/site1 var/www/site2 Then I'm assuming I need to create my git repos inside these folders And when these git repos are created, how can I make a push from my laptop to these repos? I guess is something like this (in my laptop git console): git remote add origin ssh://my_username@199.99.999.999/var/www/site1.git But I got a "Connect to host port 22 refused. The remote end hung up." Where 199.99.999.999 is my websites IP. I don't use a domain name, because I have multiple sites and the DNS are not already set until I finish a hosting transition. What am I doing wrong? Thanks a lot.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers
My setup, using gitolite, has the documentroot for my sites controlled with git to a subdirectory within /home/git. I find it easier to work with things that way.

If you want to do it all manually, without gitolite, you can just do "git init --bare" wherever you'd like, to create a repository.
Thanks Jason

I didn;t know about gitolite. Where are your sites? Inside var/www ?
I actually have a rather non-conventional setup. My documentroots are in /home/git/public_html//, but that's purely personal preference.

Gitolite is a great too with pretty good documentation.