About github url parser
A GitHub URL holds the owner, repository, branch and path. The parser splits them and offers clone and download links.
What you get
The clone URL in HTTPS and SSH form, the raw file link, a ZIP download link and the API endpoint for the repository.
A worked example
https://github.com/owner/repo/blob/main/src/index.ts splits into owner, repo, branch main and the file path src/index.ts. From it you can get the raw file link on raw.githubusercontent.com, a ZIP download URL and the API URL for the repository.
Handy for
- Linking directly to a file or a line in documentation.
- Scripts that need the clone address or the default branch.
- Spotting that a link points to a fork rather than the original project.
Permalinks
A link containing a branch name changes when the branch changes. To keep a link stable in documentation, press y on a file page to replace the branch with the commit hash.
