A simple CLI to facilitate and automate some git actions, created and optimized for Bruce's conventions.
Simply start the script with:
npx gbruce -- [action] [option]
The CLI is more useful when coupled with a terminal alias. To create one :
For Zsh
nano .zshrc
For Bash
nano .bashrc
And then, at the bottom of the file add this line:
alias aCustomAlias="npx gbruce --"
You can now start the CLI directly by using your alias aCustomAlias
on any project.
You can also install the CLI as a global NPM package like so
npm install -g gbruce
You can now create an alias like explained above by pasting this line in the correct file
alias aCustomAlias="gbruce --"
Don't do it, it's useless for the moment
The CLI allows 4 actions (for the moment).
This action will guide you to create a branch with the good naming convention. It will:
- Automatically checkout and pull changes from the specified base branch (meaning you can call this action from any branch).
- Create a branch up-to-date with the base branch, and correct naming convention.
This action will guide you to create a commit with the good naming convention. It will:
- Create a commit step by step with all the information needed for a valid commit (or I might fuck you up).
- (optional) Pull and rebase the base branch specified.
- (optional) Push the branch to remote (it'll add it to the remote if it's a new branch).
Option | Description | Value |
---|---|---|
-r |
To use if you want to make a rebase after the commit | false |
-p |
To use if you want to push your changes directly after the commit | false |
This action will make a push action with some automation. It will:
- Checkout on the specified branch (or stay on current branch), meaning that you can call this action from any branch.
- Push the branch and its changes (will automatically add it to remote if the branch doesn't exist).
Option | Description | Value |
---|---|---|
-b <name-of-the-branch-to-push> |
To use only if you want to push an other branch than -> | <current-branch> |
-f |
Specify if you want to push --force | false |
This action will show you all the available actions and their accepted argument(s)