3

I spent about 20 minutes messing around with this problem.

I was emailed an SSH address for a repository. Crucially it had a non-standard (i.e. not 22) port number: [email protected]:1234/opt/git/repository.git

I assumed I could just copy-paste that into SourceTree, but kept getting This is not a valid source path / URL error messages.

When I took a closer look at the logs, the error was that it was looking for the path 1234/opt/git/repository.git on the server - it was treating the port number as part of the path. And obviously not finding the repo.

yellow-saint
  • 884
  • 2
  • 13
  • 37

1 Answers1

6

The solution was slightly weird:

  1. Use a path like ssh://[email protected]:1234:/opt/git/repository.git. Appending ssh://, and adding a : after the port number seemed to successfully act as a delimiter, and the path /opt/git/repository.git was found (as expected) on the server.
  2. Add the domain/port number to your config file (e.g. ~/.ssh/config) so that it looks like this:

Host domain.com Port 1234

yellow-saint
  • 884
  • 2
  • 13
  • 37