A client for creating git branch easily using interactive questions.
- Easy to use
- Interactive prompt
- Fully configurable
$ yarn global add git-branch-cli
Or
$ npm install -g git-branch-cli
$ yarn add git-branch-cli
Or
$ npm install git-branch-cli
Add to package.json
file :
"scripts": {
"git-branch": "git-branch"
}
git-branch
yarn run git-branch
or
npm run git-branch
A client for creating git branch easily using interactive questions.
Usage
$ git-branch
Options
--init, -i Initialize a new branch
--version, -v Print git-branch-cli installed version
The configuration for using git-branch-cli should be located in the package.json
file.
Example :
"git-branch-cli": [
{
"name": "type",
"message": "What type is your branch ?",
"type": "autocomplete",
"choices": [
"feature",
"bug"
],
"characterAfter": "/"
},
{
"name": "name",
"message": "What is the name of the feature ?",
"characterAfter": "-"
},
{
"name": "ticket",
"message": "What is the ticket number ?",
"type": "number"
}
]
Type: string
Only for understanding the configuration
Type: string
The question that will be displayed
Type: string
Type of the answer.
Defaults: input
- Possible values: input
, number
, autocomplete
.
Type: array
The different choices for the user
Type: char
The character that will be positioned after the user's slugified answer
Type: bool
Determine if user's answer can be blank.
If this field is false
and the user's answer is blank, the characterAfter
value isn't add to branch name.
Defaults: true
Created by Théo Frison, inspired and taken for some parts from this project.