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`
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:
Open a specific branch page
Use the -b or --branch option to open a specific branch. For example, to open the develop branch:
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:
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:
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
This will open the homepage of the
originremote repository by default. -
Open the
developbranchThis will open the
developbranch of theoriginremote repository. -
View a specific commit
This will open the specific commit page for commit ID
abc1234. -
Specify a remote name
This will open the homepage of the
upstreamremote 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.