/branchlint

A git branch name script that converts to underscore standards.

Primary LanguageShellMIT LicenseMIT

Branchlint

A simple script to convert branch names into a desired format.

Features

image

  • Converts branch names like 64-bug-typed-errors-for-dynamic-typed-routing into bug/typed_errors_for_dynamic_typed_routing.

Installation

Prerequisites

  • A Unix-like operating system (Linux, macOS)
  • Bash shell

Steps

  1. Clone the repository:

    git clone https://github.com/dinogomez/branchlint.git
  2. Navigate to the repository:

    cd branchlint
  3. Make the script executable:

    chmod +x branchlint
  4. Move the script to /usr/local/bin for global access:

    sudo mv branchlint /usr/local/bin/

    You might need to enter your admin password.

  5. Ensure /usr/local/bin is in your PATH:

    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

Option 2: Set Up as an Alias

  1. Clone the repository:

    git clone https://github.com/dinogomez/branchlint.git
  2. Navigate to the repository:

    cd branchlint
  3. Make the script executable:

    chmod +x branchlint
  4. Add an alias to your shell configuration file (e.g., .bash_profile, .zshrc):

    alias branchlint="$(pwd)/branchlint"
  5. Reload your shell configuration:

    source ~/.bash_profile  # for Bash users
    source ~/.zshrc         # for Zsh users

Usage

Once the script is installed and in your PATH, you can use it from anywhere in your terminal.

branchlint <branch-name>