On the server terminal, type:
git remote add origin ssh://user@domain.com:22/home/user/remote.git
The name of your remote repo will be ‘origin’. ‘user’ is your user name, ‘domian.com’ is your domain or IP address. ‘:22’ is the port number used to connect to your ssh server. ‘/home/user/remote.git’ is the location of your remote git repo.
Before you push you will have to create a blank repo. Log onto your ssh server and create your empty repo.
git init --bare /home/user/remote.git
No you will be able to push your local repo to a remote repo. The below command just pushes your master branch.
git push origin master