{"id":13484838,"url":"https://github.com/rhysd/git-brws","last_synced_at":"2025-04-05T08:08:10.834Z","repository":{"id":49840322,"uuid":"77489707","full_name":"rhysd/git-brws","owner":"rhysd","description":"Command line tool to open repository, file, commit, diff, tag, pull request, blame, issue or project's website in browser for various repository hosting services.","archived":false,"fork":false,"pushed_at":"2023-05-05T14:19:49.000Z","size":671,"stargazers_count":172,"open_issues_count":6,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T07:07:43.946Z","etag":null,"topics":["browse","git","git-addons","open","rust"],"latest_commit_sha":null,"homepage":"https://rhysd.github.io/git-brws/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhysd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-28T00:01:06.000Z","updated_at":"2025-02-16T06:12:49.000Z","dependencies_parsed_at":"2024-01-13T19:19:18.695Z","dependency_job_id":null,"html_url":"https://github.com/rhysd/git-brws","commit_stats":{"total_commits":467,"total_committers":7,"mean_commits":66.71428571428571,"dds":"0.021413276231263434","last_synced_commit":"fb584e681b5898a5af95039bbe0fc7232e7dcc9c"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fgit-brws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fgit-brws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fgit-brws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fgit-brws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhysd","download_url":"https://codeload.github.com/rhysd/git-brws/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305934,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browse","git","git-addons","open","rust"],"created_at":"2024-07-31T17:01:35.718Z","updated_at":"2025-04-05T08:08:10.808Z","avatar_url":"https://github.com/rhysd.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"git brws\n========\n[![crates.io][crate-badge]][crate]\n[![Github Actions CI][ga-badge]][ga]\n[![Coverage][codecov-badge]][codecov]\n\n`git brws` is a command line tool to open a repository, file, commit, diff, tag, blame, pull request,\nissue or project's website in your web browser from command line. 'brws' is an abbreviation of 'browse'.\n\nFeatures:\n\n- Opens a page of\n  - Repository ([example](https://github.com/rhysd/git-brws))\n  - File ([example](https://github.com/rhysd/git-brws/blob/master/Cargo.toml))\n  - Commit ([example](https://github.com/rhysd/git-brws/commit/60024ab1280f9f10423b22bc708f3f6ef97db6b5))\n  - Diff ([example](https://github.com/rhysd/git-brws/compare/e3c18d0d50252112d37bde97061370204b3cdab7..60024ab1280f9f10423b22bc708f3f6ef97db6b5), [example](https://github.com/rhysd/git-brws/compare/e3c18d0d50252112d37bde97061370204b3cdab7...60024ab1280f9f10423b22bc708f3f6ef97db6b5))\n  - Tag ([example](https://github.com/rhysd/git-brws/tree/0.10.0))\n  - Pull request (only for GitHub and GitHub Enterprise) ([example](https://github.com/rust-lang/rust.vim/pull/290))\n  - Issue ([example](https://github.com/rhysd/git-brws/issues/8))\n  - Website ([example](https://rhysd.github.io/git-brws/))\n    - Homepage of the repository for GitHub or GitHub Enterprise, [GitLab pages][gitlab-pages], [Bitbucket Cloud][bitbucket-cloud]\n  - Blame ([example](https://github.com/rhysd/git-brws/blame/9ab093f6720c2c2fe8375408f7f3ab40a3d3337a/src/service.rs))\n- Supports following services\n  - [GitHub](https://github.com)\n  - [Bitbucket](https://bitbucket.org)\n  - [GitHub Enterprise](https://enterprise.github.com/home)\n  - [GitLab](https://about.gitlab.com/)\n  - [Azure DevOps](https://azure.microsoft.com/services/devops/)\n- Prefers commit-specific page URL (permlink)\n- Available on Linux, macOS and Windows\n\n## Installation\n\n`git brws` is available on Linux, macOS and Windows.\n\n### With [Homebrew](https://brew.sh/)\n\n```\n$ brew tap \"rhysd/git-brws\" \"https://github.com/rhysd/git-brws\"\n$ brew install git-brws\n```\n\nIt installs `git-brws` to `/usr/local/bin` and `git-brws.1` to `/usr/local/share/man/man1`.\nThis is recommended way for installation on macOS since updating to the new version is easy.\n\n### On [Arch Linux](https://www.archlinux.org/)\n\nYou can install `git-brws` via the [AUR package](https://aur.archlinux.org/packages/git-brws/):\n\n```\ngit clone https://aur.archlinux.org/git-brws.git\ncd git-brws\nmakepkg -si\n```\n\n### Download from [release page][]\n\nPre-built binary executables are available at [release page][] for following targets:\n\n- Linux 64bit (x86_64-unknown-linux-gnu)\n- macOS 64bit (x86_64-apple-darwin)\n- Windows 64bit (x86_64-pc-windows-msvc)\n- Linux 32bit (i686-unknown-linux-gnu)\n- Windows 32bit (i686-pc-windows-msvc)\n\nDownload and unarchive the binary then put the executable in `$PATH`.\n\nManpage for `man` command is available. Please find `git-brws.1` in the unarchived directory or download\nit from [here](https://raw.githubusercontent.com/rhysd/git-brws/master/git-brws.1) and copy it to the\n`man` directory in your system (e.g. `/usr/local/share/man/man1/`).\n\nNote: `git brws --help` only works when it is installed. `git brws -h` is always available.\n\n### With [cargo](https://crates.io/)\n\n```\n$ cargo install git-brws\n```\n\nIt requires Rust toolchain to build git-brws from sources.\n\n## Usage\n\n```\nUsage: git brws [Options] {Args}\n\nOptions:\n    -r, --repo REPO     Shorthand format (repo, user/repo, host/user/repo) or\n                        Git URL you want to see. When only repo name is\n                        specified, most popular repository will be searched\n                        from GitHub\n    -b, --branch BRANCH Branch name to browse\n    -d, --dir PATH      Directory path to the repository. Default value is\n                        current working directory\n    -R, --remote REMOTE Remote name (e.g. origin). Default value is a remote\n                        the current branch is tracking. If current branch\n                        tracks no branch, it falls back to 'origin'\n    -u, --url           Output URL to stdout instead of opening in browser\n    -p, --pr            Open pull request page instead of repository page. If\n                        not existing, open 'Create Pull Request' page\n    -w, --website       Open website page instead of repository page (homepage\n                        URL for GitHub, GitLab pages, Bitbucket Cloud)\n    -B, --blame         Open blame page instead of repository page. File path\n                        to blame must be passed also.\n    -c, --current-branch\n                        Open the current branch instead of default branch\n    -h, --help          Print this help\n    -v, --version       Show version\n```\n\n### Open a repository page\n\n- Repository at current directory\n\n```\n$ git brws\n```\n\n- `develop` branch\n\n```\n$ git brws -b develop\n```\n\n- `origin` remote of `develop` branch\n\n```\n$ git brws -r origin -b develop\n```\n\n- @rhysd's 'Shiba' repository\n\n```\n$ git brws -r rhysd/Shiba\n```\n\n- Most popular `react` repository on GitHub\n\n```\n$ git brws -r react\n```\n\nIt will open https://github.com/facebook/react.\n\nNote: When only repository name is specified for `-r` option, `git-brws` searches GitHub with query\n`{repo} in:name` and opens the best-matched repository page.\n\n- Specify directory of repository\n\n```\n$ git brws -d ~/.go/src/github.com/rhysd/dot-github\n```\n\n### Open a file page\n\n- File of current branch of current remote\n\n```\n$ git brws ./some/file.txt\n```\n\n- Line of the file\n\n```\n$ git brws ./some/file.txt#L123\n```\n\nNote: The `L` can be omit.\n\n- Range from line to line of the file\n\n```\n$ git brws ./some/file.txt#L123-L126\n```\n\nNote: The `L` can be omit.\n\n### Open a commit page\n\n- `HEAD` page of current repository\n\n```\n$ git brws HEAD\n```\n\n### Open a tag page\n\n- `0.10.0` tag page of current repository\n\n```\n$ git brws 0.10.0\n```\n\n### Open a diff page between commits\n\n- Diff between `HEAD` and `HEAD~3`\n\n```\n$ git brws HEAD~3..HEAD\n```\n\n- Diff between `113079b` and `60024ab`\n\n```\n$ git brws 60024ab..113079b\n```\n\n### Open a diff page from specific commit and its merge base\n\nIn addition to `..`, diff with `...` is supported.\n\n- Diff between `branchB` and the merge base commit from `branchB` into `branchA`\n\n```\n$ git brws branchA...branchB\n```\n\nIf you don't know the difference between `..` and `...`, please read `git diff --help`.\n\nNote: Only GitHub and GitHub Enterprise support `...`. For GitLab, only `...` is available.\n\n### Open a pull request page\n\n- Pull request page of current branch of current repository\n\n```\n$ git brws --pr\n```\n\n- Pull request page of specific branch of specific repository\n\n```\n# Specify my forked repository\n$ git brws --pr --repo rhysd/rust.vim -b async-contextual-keyword\n\n# Or specify original repository\n$ git brws --pr --repo rust-lang/rust.vim -b async-contextual-keyword\n```\n\nNote: Currently only GitHub and GitHub Enterprise are supported.\n\nNote: If you have created multiple pull requests at the same repository with the same branch name,\nthe command may not open a pull request page you want.\n\nNote: When a pull request page for current branch is not existing yet, it opens 'Create Pull Request'\npage instead.\n\n### Open a website for the repository\n\n```\n# Website for current repository\n$ git brws --website\n```\n\nWith `--repo` option, arbitrary repository's website can be opened.\n\n```\n# Opens https://reactjs.org\n$ git brws --website --repo react\n```\n\nIt opens a website for the repository.\n\n- For GitHub, URL for 'homepage' configuration of the repository if it's set. Otherwise\n  `https://{user}.github.io/{repo}`\n- For GitHub Enterprise, `https://pages.{host}/{user}/{repo}` or `https://{host}/pages/{user}/{repo}`\n  depending on your GitHub Enterprise configuration of subdomain isolation\n- For GitLab, [GitLab Pages][gitlab-pages]\n- For Bitbucket, [Bitbucket Cloud][bitbucket-cloud]\n\n### Open an issue page\n\n- Issue #8\n\n```\n$ git brws '#8'\n```\n\nNote: `#` is usually used for a line comment in major shells. Please quote the argument\n\n### Open a blame page\n\n- Specific file\n\n```\n$ git brws --blame some/file.txt\n```\n\n- Specific line at file\n\n```\n$ git brws --blame some/file.txt#L5\n```\n\n- Specific range at file\n\n```\n$ git brws --blame some/file.txt#L5-L9\n```\n\n### Cooperate with other tools\n\nWith `-u` option, `git brws` outputs URL to stdout.\n\nFor example, in Vim, you can write your repository URL to your text instantly.\n\n```\n:r!git brws -u\n```\n\nAnd below can open editing file in your browser.\n\n```\n:!git brws %\n```\n\n## Customization\n\nSome environment variables are available to customize behavior of `git-brws`.\n\n| Variable | Description |\n|----------|-------------|\n| `$GIT_BRWS_GIT_COMMAND` | Git command to use. If not specified, `\"git\"` will be used. |\n| `$GIT_BRWS_GHE_URL_HOST` | When you use your own GitHub Enterprise repository, you can specify its host to this variable. By default, `git brws` detects `^github\\.` as GHE host. If your GHE repository host does not match it, please specify this variable. If your repository is `https://example-repo.org/user/repo`, `example-repo.org` should be set. |\n| `$GIT_BRWS_GHE_SSH_PORT` | When you set a number to it, the number will be used for the ssh port for GitHub Enterprise URLs. |\n| `$GIT_BRWS_GITLAB_URL_HOST` | When you use self-hosted GitLab instance, you can specify its host to this variable. By default, `git brws` detects host matching to `^gitlab\\.` as GitLab. If your GitLab URL host does not match it, please specify this variable. If your repository is hosted at `https://your-code.net/user/repo`, `your-code.net` should be set. |\n| `$GIT_BRWS_GITLAB_SSH_PORT` | When you set a number to it, the number will be used for the ssh port for self-hosted GitLab URLs. This is useful when your environment hosts GitLab to non-trivial ssh port URL. |\n| `$GIT_BRWS_GITHUB_TOKEN` | This variable is used for `--pr` (or `-p`) only. API access token for github.com. They are optional, but useful for avoiding API rate limit and accessing to private repositories. Please generate a token from https://github.com/settings/tokens/new |\n| `$GITHUB_TOKEN` | Ditto. When `GIT_BRWS_GITHUB_TOKEN` is not set, `GITHUB_TOKEN` is looked. |\n| `$GIT_BRWS_GHE_TOKEN` | This variable is used for `--pr` (or `-p`) only. API access token for GitHub Enterprise instance. It is sometimes mandatory (depending on your GHE instance configuration). Please generate a token from `https://{YOUR GHE HOST}/settings/tokens/new`. |\n| `$GIT_BRWS_BROWSE_COMMAND` | Command to open URL. If this value is specified, the command is executed with URL as first argument to browse the URL. |\n| `$GIT_BRWS_SHORT_COMMIT_HASH` | Setting `true` will use 7-letters short commit hash like `78fbce6` for URLs. |\n| `$https_proxy` | This variable is used for `--pr` (or `-p`) only. An HTTPS Proxy server URL if you use a web proxy. |\n\n## Related Projects\n\n- [hub (`hub browse`)](https://hub.github.com/)\n- [git-open](https://github.com/paulirish/git-open)\n- [open-browser-github.vim](https://github.com/tyru/open-browser-github.vim)\n- [git-browse](https://github.com/albertyw/git-browse)\n\n## TODOs\n\nPlease see [the project page](https://github.com/rhysd/git-brws/projects/1).\n\n## Development\n\nPlease see [CONTRIBUTING.md](https://github.com/rhysd/git-brws/blob/master/CONTRIBUTING.md).\n\n## License\n\nDistributed under [the MIT license](LICENSE.txt).\n\n[crate-badge]: https://img.shields.io/crates/v/git-brws.svg\n[crate]: https://crates.io/crates/git-brws\n[ga-badge]: https://github.com/rhysd/git-brws/workflows/CI/badge.svg?branch=master\u0026event=push\n[ga]: https://github.com/rhysd/git-brws/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush\n[codecov-badge]: https://codecov.io/gh/rhysd/git-brws/branch/master/graph/badge.svg\n[codecov]: https://codecov.io/gh/rhysd/git-brws\n[release page]: https://github.com/rhysd/git-brws/releases\n[gitlab-pages]: https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html#project-websites\n[bitbucket-cloud]: https://confluence.atlassian.com/bitbucket/publishing-a-website-on-bitbucket-cloud-221449776.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Fgit-brws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhysd%2Fgit-brws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Fgit-brws/lists"}