repo-open
repo-open [-p|--print] [-r|--root]repo-open --helpOpens the web page for the current repository's `origin` remote in abrowser (via open-url). Deep-links to the current branch when it existson the remote, falling back to the remote's default branch (main/master)otherwise, and to the current sub-directory when invoked below the reporoot.The remote URL is normalized from both HTTPS and SSH/scp forms (git@host:owner/repo.git, ssh://…, https://…). The web path layout is provider-specific; the provider is resolved in this order:
1. git config browse.provider (per-repo or --global override) 2. Hostname heuristic (github / gitlab / gitea / bitbucket; codeberg → gitea) 3. Default: github-style layoutFor a self-hosted host the heuristic can’t classify (e.g. a Gitea or GitLab instance on a custom domain), set the provider once:
git config browse.provider giteaArguments:
-p, --print |
Print the resolved URL instead of opening it |
-r, --root |
Ignore the current sub-directory; link to the repo root |
-h, --help |
Print usage and exit |
Returns:
0 |
URL opened (or printed) |
1 |
Not a git repo, no origin remote, or browser launch failed |
Notes: Typo abbreviation: open-repo (expands to repo-open on space/enter).repo-open # open current branch (+ subdir) in browserrepo-open --print # just print the URLrepo-open --root # repo home page for the current branchDependencies: open-url