Git remote repository with a custom SSH port
Tagged:  •  

I keep forgetting this, so I'd better jot it down here once and for all. To add a Git remote repository, accessible through SSH with a different port than 22, execute:

git remote add office ssh://username@hostname:2222/home/bram/.repository

So this adds a remote repository behind port 2222 of the host, immediately followed by the remote path of the repository. The ssh:// part is crucial and forgetting this part has cost already some minutes of my life.