Your brain shouldn't waste cycles on branch names.
Type gnb and get username/YYMMDD—done.
curl -LsSf https://gnb.bfoos.net/install.sh | bashThis downloads the prebuilt binary for your platform (macOS Apple Silicon/Intel or Linux).
Binaries available on GitHub Releases.
cargo install --git https://github.com/BrianSigafoos/git-new-branch# Create branch with today's date: username/YYMMDD
gnb
# Create branch with ticket number: username/ABC-123
gnb ABC-123
# Create branch with description: username/fix-login-bug
gnb fix login bug
# Multiple words become dashes
gnb "my new feature"If a branch already exists, a numeric suffix is automatically added:
gnb ABC-123 # → username/ABC-123
gnb ABC-123 # → username/ABC-123_2
gnb ABC-123 # → username/ABC-123_3Override the username with the GNB_PREFIX environment variable:
GNB_PREFIX=ci-bot gnb
# → ci-bot/YYMMDD- Detects your system username (or uses
GNB_PREFIX) - Sanitizes the branch name (spaces → dashes, removes invalid chars)
- Checks local and remote branches for collisions
- Adds
_2,_3, etc. suffix if branch exists - Creates and switches to the new branch
| Command | Result |
|---|---|
gnb |
username/241215 |
gnb ABC-123 |
username/ABC-123 |
gnb fix login |
username/fix-login |
gnb "my feature" |
username/my-feature |
GNB_PREFIX=bot gnb |
bot/241215 |
Contributions welcome.
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Verify
rustc --version
cargo --version# Build debug version
cargo build
# Run directly
cargo run
cargo run -- --help
cargo run -- ABC-123
# Build optimized release
cargo build --release# Check code compiles
cargo check
# Run tests
cargo test
# Format code
cargo fmt
# Lint code
cargo clippyReleases are managed with cargo-release.
# Install cargo-release (one-time)
cargo install cargo-release
# Release a new version
cargo release patch # 0.1.0 → 0.1.1
cargo release minor # 0.1.0 → 0.2.0
cargo release major # 0.1.0 → 1.0.0
# Dry run
cargo release patch --dry-runThe push triggers the GitHub Actions release workflow.