Git URL Parser
Break a git remote URL into host, owner and repository, and convert between SSH, HTTPS and web forms.
Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.
How to use the git url parser
- Paste a git remote URL in any of the three forms.
- Read the host, owner and repository it resolves to.
- Copy the SSH, HTTPS or web form you need.
About this tool
Git accepts three shapes of remote that look similar and parse differently. `https://host/owner/repo.git` is an ordinary URL. `ssh://git@host:2222/owner/repo.git` is a URL with an explicit port. And `git@host:owner/repo.git` is not a URL at all — it is scp syntax, where the colon separates the host from the path rather than introducing a port number.
That last form is why generic URL parsers get this wrong. Handed the scp shorthand they either fail or read the entire string as a path, which is how tooling ends up with a repository apparently named `owner/repo`. This parser handles all three, and keeps nested groups intact so a GitLab subgroup path survives rather than being flattened.
Converting between SSH and HTTPS is the everyday use. SSH authenticates with your key and is the usual choice for anything you push to; HTTPS gets through corporate proxies and firewalls that block port 22. The same repository is reachable both ways, and switching is a matter of rewriting the remote.
A URL carrying a username and token is flagged, because storing one as a remote writes it in plain text to `.git/config` and prints it in the output of `git remote -v`. That is a credential exposed to anything reading the working copy, and the answer is a credential helper rather than a URL.
Common uses
- Converting a remote from SSH to HTTPS to get through a firewall.
- Extracting owner and repository names for a script or a CI config.
- Checking whether a remote URL is carrying an access token.
Frequently asked questions
- Why does git@github.com:owner/repo.git have a colon?
- Because it is scp syntax rather than a URL. The colon separates the host from the path, which is why it cannot carry a port number and why URL parsers mishandle it.
- Should I use SSH or HTTPS to clone?
- SSH authenticates with your key and suits anything you push to. HTTPS works through proxies and firewalls that block SSH, which is often the deciding factor on a corporate network.
- Is it safe to put a token in a remote URL?
- No. It is stored unencrypted in .git/config and shown by git remote -v, so anything that can read the working copy can read the token. Use a credential helper instead.
Related tools
Gitignore Generator
Build a .gitignore from language, framework, editor and operating system sections, with duplicates removed.
Semantic Version Comparator
Compare two semantic versions by precedence, including prerelease ordering and caret or tilde ranges.
URL Parser
Break any URL into protocol, host, port, path, query parameters and fragment.
URL Builder
Build a URL from a base address and named parameters, with encoding handled for you.