gitui icon indicating copy to clipboard operation
gitui copied to clipboard

git error:invalid url: malformed hostname; class=Net (12); code=InvalidSpec (-12) for ipv6 address

Open tomaszkubacki opened this issue 1 year ago • 1 comments

gitui does not seem to fetch/push from valid ipv6 addresses

*Steps to reproduce While pulling ("f" key) from ipv6 addresed repo (git url defined as: ssh://MY_IPV_6_ADDRESS_HERE/~/projects/my_proj) i am getting following error:

git error:invalid url: malformed hostname; class=Net (12); code=InvalidSpec (-12) for ipv6 address

tomaszkubacki avatar Dec 01 '24 06:12 tomaszkubacki

Thank you for this report. I am surprised that git allows the use of URIs that contain IPv6 addresses that are not bracketed as required by RFC 3986.

For a workaround, @tomaszkubacki: Add a username and brackets to the URI, i.e. git remote set-url origin 'ssh://tk@[::1]/~/projects/my_proj' (replace origin with the remote name, tk with your remote user name and ::1 with the remote IPv6 address.) This will work with both git and gitui.

naseschwarz avatar Mar 17 '25 13:03 naseschwarz