A simple script to convert branch names into a desired format.
- Converts branch names like
64-bug-typed-errors-for-dynamic-typed-routing
intobug/typed_errors_for_dynamic_typed_routing
.
- A Unix-like operating system (Linux, macOS)
- Bash shell
-
Clone the repository:
git clone https://github.com/dinogomez/branchlint.git
-
Navigate to the repository:
cd branchlint
-
Make the script executable:
chmod +x branchlint
-
Move the script to
/usr/local/bin
for global access:sudo mv branchlint /usr/local/bin/
You might need to enter your admin password.
-
Ensure
/usr/local/bin
is in yourPATH
:echo $PATH
If
/usr/local/bin
is not listed in the output, add it to your shell configuration file (e.g.,.bash_profile
,.zshrc
):export PATH="/usr/local/bin:$PATH"
Then, reload your shell configuration:
source ~/.bash_profile # for Bash users source ~/.zshrc # for Zsh users
-
Clone the repository:
git clone https://github.com/dinogomez/branchlint.git
-
Navigate to the repository:
cd branchlint
-
Make the script executable:
chmod +x branchlint
-
Add an alias to your shell configuration file (e.g.,
.bash_profile
,.zshrc
):alias branchlint="$(pwd)/branchlint"
-
Reload your shell configuration:
source ~/.bash_profile # for Bash users source ~/.zshrc # for Zsh users
Once the script is installed and in your PATH
, you can use it from anywhere in your terminal.
branchlint <branch-name>