4 releases
0.1.4 | Nov 27, 2024 |
---|---|
0.1.3 | Aug 22, 2023 |
0.1.2 | Jul 28, 2023 |
0.1.1 | Jul 24, 2023 |
0.1.0 |
|
#642 in Web programming
152 downloads per month
15KB
274 lines
git-github-open
git-github-open
is a convenient Git command plugin that allows you to quickly open the remote repository URL in your browser. It supports both GitHub and GitLab, making it easier for developers to access remote repositories, specific branches, or commit records for code review, changes, or sharing.
Features
- Multi-Platform Support: Opens remote repository URLs for GitHub and GitLab.
- Quick Branch Access: Specify a branch to open.
- View Specific Commits: Open a specific commit page directly.
- Custom Remote Repository: Specify different remote names (default is
origin
).
Installation
# Install using `cargo`
cargo install git-github
Usage
Open the default remote repository page
Run the following command in the root directory of your repository to open the main page of the remote repository in your browser:
git github open
Open a specific branch page
Use the -b
or --branch
option to open a specific branch. For example, to open the develop
branch:
git github open --branch develop
Open a specific commit page
Use the -c
or --commit
option to open a specific commit page. For example, to open a commit with ID abc1234
:
git github open --commit abc1234
Specify a remote repository name
If the remote repository name is not origin
, you can use the -r
or --remote
option to specify it. For example:
git github open --remote upstream
Full Options List
Usage: git-github open [OPTIONS]
Options:
-c, --commit <COMMIT> Open a specific commit page
-b, --branch <BRANCH> Open a specific branch page
-r, --remote <REMOTE> Specify the remote repository name (default: origin)
-h, --help Print help
Examples
-
Open the repository homepage
git github open
This will open the homepage of the
origin
remote repository by default. -
Open the
develop
branchgit github open --branch develop
This will open the
develop
branch of theorigin
remote repository. -
View a specific commit
git github open --commit abc1234
This will open the specific commit page for commit ID
abc1234
. -
Specify a remote name
git github open --remote upstream
This will open the homepage of the
upstream
remote repository.
Contributing
We welcome contributions via Issues or Pull Requests! If you have any questions or suggestions, feel free to reach out.
License
This project is licensed under the MIT License.
Dependencies
~15–28MB
~494K SLoC