Creating a remote Git repository on a Linode server

Notes from the bookmark ...

You should now be in that user’s home directory, something like /home/username. You can setup the directory structure however you want, but for me, I like to keep things organized by first creating a directory called git for storing all my repositories.

$ mkdir git
$ cd git

Now you can create a directory for a particular repository with whatever name you want for it and then append .git to the end.

$ mkdir blog.git
$ cd blog.git

The repository can be initialized now (with the bare option).

$ git --bare init

That’s it, it is all setup. I know it was difficult, but definitely worth the struggle.

One last step to simplify your life is to switch back to your local repository and setup the remote repository with a name that can be easily referenced.

$ git remote add linode username@domain.com:~/git/blog.git

Note: This last step is done locally (not on your linode server) in the existing git repository that cooresponds to the one you plan to push to the remote linode repository.

This last step makes pushing your changes to the linode server easy.

$ git push linode master

In my case the correct remote add command is this:

git remote add linode ssh://USER@DOMAIN:PORT/path/to/git/MyApp.git