Welcome to git-open documentation¶
Installation¶
Basic install on Linux¶
The easiest way of install is to build the tool and put git-open
somewhere into your path, for example by copying it into an existing included path like /usr/local/bin
.
To install the man page generate the man page and put git-open.1
it somewhere in the path specified by man --path
.
Note that you main need to create a subdirectory man1
and put it in there.
git-open man page¶
Synopsis¶
git-open
[options]
Description¶
git-open
opens the page of the repository on the Git Hosting Service in your browser.
Options¶
--help
- Open the man page.
-h
- Display short help.
--version
- Display the programs version.
--print
- Instead of opening, display the resulting URL.
-i
,--issues
- Open the Issues page.
-n
,--new-issue
- Open the page to create a new issue.
-I
,--issue
Open the current issue page.
When the name of the current branch contains a number, the first number in the branch name is considered to be the number of the issue this branch is related to. It will open the page with that issue. When no number is found in the branch name it will open the general Issue page.
-p
,--prs
- Open the Pull Requests page.
-m
,--mrs
- Open the Merge Requests page.
-N
,--new-pr
,--new-mr
- Open the new Pull Request or new Merge Request page based on the current branch. This assumes the current branch has already been pushed to the remote.
-l
,--pipelines
- Open the Pipelines page on GitLab. If the option is used on a GitHub repository, it will open the GitHub Actions page.
-a
,--actions
- Open the GitHub Actions page. If the option is used on a GitLab repository, it will open the GitLab Pipelines page.
Configuration¶
To configure git-open
you may need to set some git config
options.
You can use --global
to set across all repositories, instead of just the current one.
git config [--global] option value
Configuring which remote to open¶
If there is only one remote, git-open
always opens that.
Otherwise git-open
opens the remote named origin
, but you may want to override this behavior.
When you fork a project and add a remote named upstream
you often want that upstream
to be opened rather than your fork.
To accomplish this, you can set the open.default.remote
within your project:
git config open.default.remote upstream
Supported Git Hosting Services¶
git-open
can determine the page of the repository for the following git hosting services:
- github.com
- gitlab.com
- Self-hosted GitLab, when its hostname contains
gitlab
- bitbucket.org
Know that not all command line options work on every hosting service. In that case the default page of the repository is opened.