Tracking a new git remote repository on a local machine

If you have a bare Git repository on a remote machine, on which you have root ssh access, you can easily use the following shell command to add that branch on your local machine.

$ git remote add origin ssh://yourUsername@remoteHostname:remotePort/mnt/Drive1/folder1/yourRepositoryFolder

A real case scenario:

$ git remote add origin ssh://frodo@theshire:24681/home/frodo/git/repos/bigProject

Receive more posts like this in your mailbox, no spam!

comments powered by Disqus