Git, square brackets in URL



We are using TeamCity Professional 2020.1.4 (build 78906). It's impossible to create git root repository using URL with square brackets (specifying port for scp-like URLs), for example:


generates exception:
List remote refs failed: com.jcraft.jsch.JSchException: [

It's more of an issue with submodules, where submodule URL contains square brackets. It can be fixed by using ssh protocol for URLs, but git cli itself supports square brackets without issues.



Hi Dmitri,


Thanks for your report, but I've not seen this type of URLs used before. Is there any specific reason you need to use the brackets? URLs should accept using ports without the need for brackets anyway, am I missing something?


If you would need this feature, please feel free to open a feature request in our tracker: . Please detail the use case as to why you use bracketed URLs instead of regular ones.


Hi Denis,

Yep, thanks, I'll create a ticket.

It's more of an issue for submodules. We've got multiple git repositories with a lot of submodules where path is set in "scp-like" style (those colons between address and path), which works fine with git itself. For example:

[submodule "Foo"]
path = foo
url =
[submodule "Bar"]
path = bar
url = []:bar

It can be easily fixed converting "scp-like" style to the full ssh URL:
[submodule "Bar"]
path = bar
url = ssh://

We are using scp-like syntax cause it's slightly shorter and it's the "default" style for clone or add module commands. 



Please sign in to leave a comment.