gh-alias-cli
v1.0.10
Published
A CLI tool for GitHub command aliases.
Downloads
18
Readme
GitHub CLI Alias Tool
Overview
The GitHub CLI Alias Tool simplifies and accelerates common GitHub operations with easy-to-use command aliases.Helping developers streamline their workflows and enhance productivity.
Installation
Install the GitHub CLI Alias Tool globally using npm:
npm install -g gh-alias-cli
Commands
gnb <branch-name>
Alias for: git checkout -b <branch-name>
Creates and switches to a new Git branch.
Usage:
gnb <branch-name>
gc <message>
Alias for: git commit -m "<message>"
Commits changes with a specified message.
Usage:
gc <message>
gp
Alias for: git push
Pushes changes to the remote repository.
Usage:
gp
gpl [branch-name]
Alias for: git pull
or git pull origin <branch-name>
Pulls changes from the remote repository. Defaults to the current branch if no branch name is provided.
Usage:
gpl [branch-name]
gco <branch-name>
Alias for: git checkout <branch-name>
Switches to an existing Git branch.
Usage:
gco <branch-name>
grst <commit-hash>
Alias for: git reset --hard <commit-hash>
Resets the current branch to the specified commit, discarding all changes.
Usage:
grst <commit-hash>
gpr
Alias for: gh pr create --base <base-branch> --head <head-branch>
Create a GitHub Pull Request directly from your CLI without needing to use the UI. This command allows you to raise a PR for the dev
or main
branch from the command line.
Flags:
-d
: Usedev
as the base branch.-m
: Usemain
as the base branch.
Usage:
gpr [-d | -m]
Examples:
gpr -d
Creates a Pull Request from the current branch to the dev branch.
gpr -m
Creates a Pull Request from the current branch to the main branch.
gpr
Creates a Pull Request from the current branch to the default base branch, which is dev. If you don't specify a flag, it will default to dev.
pre requisite
install-gh <platform>
Installs GitHub CLI based on the specified platform.
Platforms:
darwin
(macOS)linux
(various distributions)win32
(Windows)
Example Usage:
- To install on macOS:
gh-alias-cli install-gh darwin
- To install on Ubuntu:
gh-alias-cli install-gh linux
- To install on Windows:
gh-alias-cli install-gh win32