gbruce
v1.3.0
Published
gitBruce CLI for Bruce Web team
Downloads
7
Readme
📦 gBruce - A git CLI for Bruce.work
A simple CLI to facilitate and automate some git actions, created and optimized for Bruce's conventions.
Requires Node.js v14+
INSTALLATION
Recommanded (with npx)
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.
Globally
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 --"
Per project
Don't do it, it's useless for the moment
HOW TO USE
The CLI allows 4 actions (for the moment).
gbruce branch
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.
gbruce commit [option]
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 |
gbruce push [option]
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 |
gbruce help
This action will show you all the available actions and their accepted argument(s)