Creating a Remote Git Repository

Here is a quick and dirty guide to create your own remote repository. Access is controlled through standard ssh so it’s as secure as your ssh access is.

$ mkdir /git/repos/myapp.git
$ cd /git/repos/myapp.git
$ git --bare init
$ exit

On your local machine, find the local git repository that you want to push to the remote location.

$ git remote add origin ssh://yourdomain.com/git/repos/myapp.git
$ git push origin master

Now your local repo will be tracking the remote repository and you may continue pushing/pulling it from anywhere.

Leave a Reply