I have a local Git repository. I would like to make it available on a remote, ssh-enabled, server. How do I do this?
You need to create a directory on a remote server. Then use "git init" command to set it as a repository. This should be done for each new project you have (each new folder)
Assuming you have already setup and used git using ssh keys, I wrote a small Python script, which when executed from a working directory will set up a remote and initialize the directory as a git repo. Of course, you will have to edit script (only once) to tell it server and Root path for all repositories.
Check here - https://github.com/skbobade/ocgi
I think you make a bare repository on the remote side, git init --bare
, add the remote side as the push/pull tracker for your local repository (git remote add origin URL
), and then locally you just say git push origin master
. Now any other repository can pull
from the remote repository.