0

Anyone know how I'd specify a non standard port in this code?

git ls-remote git@git:2222:common/jenkins-libraries.git

Our git server is running on a non standard port, 2222, so I need to get the port into that command somehow.

vandekerkoff
  • 415
  • 8
  • 24
  • 1
    Try `git ls-remote git@${host}:2222/common/jenkins-libraries.git`. – ElpieKay Apr 12 '19 at 10:56
  • 1
    https://stackoverflow.com/search?q=%5Bgit%5D+ssh+port+url – phd Apr 12 '19 at 11:13
  • 1
    Especially this answer: https://stackoverflow.com/a/5738592/7976758. So you cannot set port in scp-like URL. Rewrite it with `ssh://` protocol: `git ls-remote ssh://git@git:2222/common/jenkins-libraries.git`. – phd Apr 12 '19 at 11:14
  • Thanks all. I created a .ssh/config file in the end and put the port and some other details in there. – vandekerkoff Apr 12 '19 at 16:24

0 Answers0