Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (19.4k 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 (27.5k 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

0 votes
1 answer
0 votes
1 answer
asked Jul 20, 2019 in DevOps and Agile by chandra (29.3k points)
0 votes
1 answer
asked Sep 30, 2019 in Java by Anvi (10.2k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.1k users

Browse Categories