How to create a remote Git repository
This guide shows you how to create a remote Git repository on a server with SSH.
The steps:
- Connect to your server with SSH and create a directory for the new repository.
- Write
git --init bare repository.git
in your shell. - Go to your local Git repository and write:
git remote add origin ssh://user@server/path/to/repo/repository.git
- Push to the server:
git push -u origin master
That's it!