0 votes
1 view
in DevOps and Agile by (20k points)

In Git, how can I add a remote origin server when my host uses a different SSH port?

$ git remote add origin ssh://[email protected]/srv/git/example

1 Answer

0 votes
by (28.4k points)

Let us take an example, where 1234 is the SSH port being used by the host (which is a different SSH port), now if I want to add a remote origin server, I would have to do this:

git remote add origin ssh://[email protected]:1234/srv/git/example.git

Here, 1234 is the ssh port being used

Also, use absolute path, not a relative path to user home directory

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !