Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tomaszkubacki opened this issue Dec 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tomaszkubacki
Copy link

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 tomaszkubacki added the bug Something isn't working label Dec 1, 2024
@naseschwarz
Copy link
Contributor

naseschwarz commented Mar 17, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants