Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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://user@host/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://user@host: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)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...