🌳 A CLI tool to help with conventional git branch names
This package was built on the idea that some projects prefer to keep consistent git branch names.
Instead of remembering and manually entering the branch name to conform to the pattern, Deku Tree uses CLI prompts to produce a standardized branch name that then gets passed to a git branch command.
Use it when going alone would otherwise be dangerous!
Branch names are produced with the following format, with an example below:
${type}/${project}-${ticketNumber}-${description}
feature/PROJ-123-add-the-thing
To break this down:
type
is the branch type, chosen from an array ofbug
,feature
, ortechdebt
project
is your project's name, passed into the command as part of the scriptticketNumber
is the ticket number, prompted by a text inputdescription
is the ticket description, prompted by a text input and result will be kebab-cased
Once the branch string is concatenated, it gets passed to a git checkout -b
command, and the process exits with the user on the new git branch.
npm i -D deku-tree
- In your
package.json
, inside ofscripts
add"branch": "deku-tree --project PROJ"
, wherePROJ
is your alphanumeric project name - Run the command from the terminal with
npm run branch
- Enter the prompts and the process will create and checkout your new git branch
Happy branching! 🌳