.\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . .TH "GIT\-BRWS" "1" "September 2020" "" "" . .SH "NAME" \fBgit\-brws\fR \- open a repository, file, commit, diff, pull request or issue in your web browser . .SH "SYNOPSIS" \fBgit brws\fR . .br \fBgit brws\fR \fIfile\fR\.\.\. . .br \fBgit brws\fR \fIfile\fR#\fIlnum\fR\.\.\. . .br \fBgit brws\fR \fIbranch\fR . .br \fBgit brws\fR \fIcommit\fR . .br \fBgit brws\fR \fItag\fR . .br \fBgit brws\fR \fIcommit\fR\.\.\fIcommit\fR . .br \fBgit brws\fR \fIcommit\fR\.\.\.\fIcommit\fR . .br \fBgit brws\fR \-\-repo \fIrepo\fR . .br \fBgit brws\fR \-\-pr . .br \fBgit brws\fR \-\-website . .br . .SH "DESCRIPTION" \fBgit\-brws\fR is a command line tool to open a repository, file, commit, diff, tag, blame, pull request, issue or project\'s website in your web browser from command line\. \'brws\' is an abbreviation of \'browse\'\. . .P Example of pages which \fBgit\-brws\fR can open are: . .IP "\(bu" 4 \fBRepository\fR: https://github\.com/rhysd/git\-brws . .IP "\(bu" 4 \fBFile\fR: https://github\.com/rhysd/git\-brws/blob/38f46f1/Cargo\.toml . .IP "\(bu" 4 \fBPart of file\fR: https://github\.com/rhysd/git\-brws/blob/38f46f1/Cargo\.toml#L2\-L10 . .IP "\(bu" 4 \fBCommit\fR: https://github\.com/rhysd/git\-brws/commit/60024ab . .IP "\(bu" 4 \fBDiff\fR: https://github\.com/rhysd/git\-brws/compare/e3c18d0\.\.60024ab . .IP "\(bu" 4 \fBTag\fR https://github\.com/rhysd/git\-brws/tree/0\.10\.0 . .IP "\(bu" 4 \fBPull request\fR: https://github\.com/rust\-lang/rust\.vim/pull/290 . .IP "\(bu" 4 \fBIssue\fR: https://github\.com/rhysd/git\-brws/issues/8 . .IP "\(bu" 4 \fBWebsite\fR: https://rhysd\.github\.io/git\-brws . .IP "\(bu" 4 \fBBlame\fR: https://github\.com/rhysd/git\-brws/blame/9ab093f/src/service\.rs . .IP "" 0 . .P \fBgit\-brws\fR prefers permlink to the latest page since the latest page will change when new commit is pushed to the branch\. . .SH "SERVICES" \fBgit\-brws\fR supports GitHub, GitHub Enterprise, BitBucket, GitLab as Git repository hosting services\. . .IP "\(bu" 4 \fBGitHub\fR: https://github\.com . .IP "\(bu" 4 \fBBitbucket\fR: https://bitbucket\.org . .IP "\(bu" 4 \fBGitHub Enterprise\fR: https://enterprise\.github\.com/home . .IP "\(bu" 4 \fBGitLab\fR: https://about\.gitlab\.com/ . .IP "\(bu" 4 \fBAzure DevOps\fR: https://azure\.microsoft\.com/services/devops/ . .IP "" 0 . .SH "OPTIONS" In addition to arguments described in \fISERVICES\fR, following options are available as command line arguments\. All are optional\. . .TP \fB\-r\fR, \fB\-\-repo\fR \fIREPO\fR Specify which repository should be open\. \fIREPO\fR is one of (1) shorthand format (repo, user/repo, host/user/repo) or (2) Git URL you want to see\. When only repository name is specified, \fBgit\-brws\fR searches GitHub with query \'{repo} in:name\' and opens the best\-matched repository page\. . .TP \fB\-b\fR, \fB\-\-branch\fR \fIBRANCH\fR Branch name to browse\. . .TP \fB\-d\fR, \fB\-\-dir\fR \fIPATH\fR Directory path to the repository\. Default value is current working directory\. . .TP \fB\-R\fR, \fB\-\-remote\fR \fIREMOTE\fR Remote name (e\.g\. origin)\. Default value is a remote the current branch is tracking\. If current branch tracks no branch, it falls back to \'origin\'\. . .TP \fB\-u\fR, \fB\-\-url\fR Output URL to stdout instead of opening in browser\. . .TP \fB\-p\fR, \fB\-\-pr\fR Open pull request page instead of repository page\. If not existing, open \'Create Pull Request\' page\. . .TP \fB\-w\fR, \fB\-\-website\fR Open website page instead of repository page (homepage URL for GitHub, GitLab pages, Bitbucket Cloud) . .TP \fB\-B\fR, \fB\-\-blame\fR Open blame page instead of repository page\. File path to blame must be passed also\. . .TP \fB\-c\fR, \fB\-\-current\-branch\fR Open the current branch instead of default branch\. . .TP \fB\-h\fR, \fB\-\-help\fR Print this help\. . .TP \fB\-v\fR, \fB\-\-version\fR Show version\. . .SH "EXAMPLES" . .SS "Current repository page\." . .nf $ git brws . .fi . .SS "\'develop\' branch\." . .nf $ git brws \-b develop . .fi . .SS "\'origin\' remote of \'develop\' branch\." . .nf $ git brws \-r origin \-b develop . .fi . .SS "@rhysd\'s \'Shiba\' repository on GitHub\." . .nf $ git brws \-r rhysd/Shiba . .fi . .SS "Most popular \'react\' repository on GitHub" . .nf $ git brws \-r react . .fi . .SS "Repository specified by directory\." . .nf $ git brws \-d ~/\.go/src/github\.com/rhysd/dot\-github . .fi . .SS "File of current branch of current remote\." . .nf $ git brws \./some/file\.txt . .fi . .SS "Line of the file\." . .nf $ git brws \./some/file\.txt#L123 . .fi . .P \fINote:\fR The \'L\' can be omit\. . .SS "Range from line to line of the file\." . .nf $ git brws \./some/file\.txt#L123\-L126 . .fi . .P \fINote:\fR The \'L\' can be omit\. . .SS "\'HEAD\' page of current repository\." . .nf $ git brws HEAD . .fi . .SS "\'0\.10\.0\' tag page of current repository" . .nf $ git brws 0\.10\.0 . .fi . .SS "Diff between \'HEAD\' and \'HEAD~3\'\." . .nf $ git brws HEAD~3\.\.HEAD . .fi . .SS "Diff between \'113079b\' and \'60024ab\'\." . .nf $ git brws 60024ab\.\.113079b . .fi . .P In addition to \'\.\.\', diff with \'\.\.\.\' is supported\. . .SS "Diff between \'branchB\' and the merge base commit from \'branchB\' into \'branchA\'" . .nf $ git brws branchA\.\.\.branchB . .fi . .P \fINote:\fR If you don\'t know the difference between \'\.\.\' and \'\.\.\.\', please read \'git diff \-\-help\'\. . .P \fINote:\fR Only GitHub and GitHub Enterprise support \'\.\.\.\'\. For GitLab, only \'\.\.\.\' is available\. . .SS "Pull request page of current branch of current repository\." . .nf $ git brws \-\-pr . .fi . .P Note: When a pull request page for current branch is not existing yet, it opens \'Create Pull Request\' page instead\. . .SS "Pull request page of specific branch of specific repository\." . .nf # Specify my forked repository $ git brws \-\-pr \-\-repo rhysd/rust\.vim \-b async\-contextual\-keyword # Or specify original repository $ git brws \-\-pr \-\-repo rust\-lang/rust\.vim \-b async\-contextual\-keyword . .fi . .P \fINote:\fR Currently only GitHub and GitHub Enterprise are supported\. . .P \fINote:\fR If you have created multiple pull requests at the same repository with the same branch name, the command may not open a pull request page you want\. . .P \fINote:\fR When a pull request page for current branch is not existing yet, it opens \'Create Pull Request\' page instead\. . .SS "Website for the repository" . .nf # Website for current repository $ git brws \-\-website # Website of other repository $ git brws \-\-website \-\-repo git\-brws . .fi . .P \fINote:\fR It opens a website for the repository\. . .IP "\(bu" 4 For GitHub, URL for \'homepage\' configuration of the repository if it\'s set\. Otherwise \'https://{user}\.github\.io/{repo}\' . .IP "\(bu" 4 For GitHub Enterprise, \'https://pages\.{host}/{user}/{repo}\' or \'https://{host}/pages/{user}/{repo}\' depending on your GitHub Enterprise configuration of subdomain isolation . .IP "\(bu" 4 For GitLab, GitLab Pages . .IP "\(bu" 4 For Bitbucket, Bitbucket Cloud . .IP "" 0 . .SS "An issue page\." . .nf $ git brws \'#8\' . .fi . .P \fINote:\fR \'#\' is usually used for a line comment in major shells\. Please quote the argument . .SS "Blame a file" . .nf $ git brws \-\-blame some/file\.txt . .fi . .SS "Blame specific line of a file" . .nf $ git brws \-\-blame some/file\.txt#L5 . .fi . .SS "Blame specific range of a file" . .nf $ git brws \-\-blame some/file\.txt#L5\-L9 . .fi . .SH "ENVIRONMENT" . .TP \fB$GIT_BRWS_GIT_COMMAND\fR Git command to use\. If not specified, "git" will be used\. . .TP \fB$GIT_BRWS_GHE_URL_HOST\fR When you use your own GitHub Enterprise repository, you can specify its host to this variable\. By default, \fBgit\-brws\fR 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\. . .TP \fB$GIT_BRWS_GHE_SSH_PORT\fR When you set a number to it, the number will be used for the ssh port for GitHub Enterprise URLs\. . .TP \fB$GIT_BRWS_GITLAB_URL_HOST\fR When you use self\-hosted GitLab instance, you can specify its host to this variable\. By default, \fBgit\-brws\fR 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\. . .TP \fB$GIT_BRWS_GITLAB_SSH_PORT\fR 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\. . .TP \fB$GIT_BRWS_GITHUB_TOKEN\fR 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 . .TP \fB$GITHUB_TOKEN\fR Ditto\. When $GIT_BRWS_GITHUB_TOKEN is not set, $GITHUB_TOKEN is looked\. . .TP \fB$GIT_BRWS_GHE_TOKEN\fR 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\'\. . .TP \fB$GIT_BRWS_BROWSE_COMMAND\fR Command to open URL\. If this value is specified, the command is executed with URL as first argument to browse the URL\. . .TP \fB$GIT_BRWS_SHORT_COMMIT_HASH\fR Setting \'true\' will use 7\-letters short commit hash like \'78fbce6\' for URLs\. . .TP \fB$https_proxy\fR This variable is used for \'\-\-pr\' (or \'\-p\') only\. An HTTPS Proxy server URL if you use a web proxy\. . .SH "REPOSITORY" \fBgit\-brws\fR is developed at repository hosted on GitHub\. . .P https://github\.com/rhysd/git\-brws . .SH "BUGS" Please visit issues page to see known bugs\. If you\'ve found a new bug, please report it here\. . .P https://github\.com/rhysd/git\-brws/issues . .SH "COPYRIGHT" \fBgit\-brws\fR is licensed under the MIT License Copyright (c) 2016 rhysd . .SH "SEE ALSO" GIT(1)