Categorygithub.com/devadathanmb/gitbm
modulepackage
0.0.0-20241026152123-7da44d4724b3
Repository: https://github.com/devadathanmb/gitbm.git
Documentation: pkg.go.dev

# README

gitbm

A fast (probably), lightweight (I guess so) Git branch bookmarking tool written in Go, powered by SQLite, and FZF with the magic of Git hooks.

image

Why gitbm?

When you’re working on a big feature or in a team environment, managing multiple branches can become quite a challenge. Here’s why gitbm helps (or at least tries to help):

  • You’re working on a huge feature split into multiple smaller tasks. Each task has its own branch, and you can’t remember all those branch names.
  • If you have the memory of an elephant, this tool is not for you. But if you’re like me, who forgets branch names after a day or two, then this tool is definitely for you.
  • Your team uses weird branch naming conventions like JIRA-xyz123 or CLICKUP-456, and remembering these names is like remembering the 100th digit of Pi.
  • You just want to bookmark branches with meaningful alias like boss-needs-it-tomorrow and not worry about remembering the cryptic original names.
  • It knows your pain branches and the ones you’ve cried over, so you can easily checkout your favorites and weep with joy!

How It Works?

  • Everything happens locally in your Git repository. Your git configs are safe and untouched.
  • A SQLite database (fancy but necessary!) is created in the .git directory of your repo to store branch names and aliases.
  • Every time you run a gitbm command, the tool reads from this magical database, does its thing, and updates the database as needed.
  • With those Git hooks doing their thing, gitbm remembers your recent and frequent branches so you don’t have to!

Installation

  1. Make sure you’ve got Go installed (if not, download it here).

  2. Run the following command to install gitbm:

    go install github.com/devadathanmb/gitbm@latest
    
  3. For basic shell completions, run the following command:

    gitbm completion zsh >> ~/.zshrc # Example for Zsh, you can put completion files in more appropriate locations.
    

Usage

For full command details, just ask for help:

gitbm --help

Some Cool Stuff You Can Do:

  • Fuzzy checkout to one of your latest top 10 branches:

    gitbm recent
    
  • Fuzzy checkout to one of your recent frequently checked out branches:

    gitbm recent frequent
    
  • Fuzzy checkout to one of your top 10 most frequently checked out branches:

    gitbm frequent
    
  • Create bookmark groups and add branches to them:

    gitbm create "group-name"
    gitbm add
    
  • Fuzzy checkout to a bookmarked branch:

    gitbm checkout
    
  • Fuzzy remove a bookmarked branch:

    gitbm remove
    

And many more! Check out the help command for more details.

TODO

  • Shell completion (because typing is hard).
  • Fuzzy search (FZF) for remove and delete commands.
  • Add recent command with automatic branch tracking with git hooks.
  • Add reset command to recent and frequent commands.
  • Add FZF support to add command.
  • Track branch deletions automatically.
  • Track new branches automatically.
  • Better CLI output.
  • Better error messages.
  • Add some tests (maybe?)

License

This project is licensed under the GPL-3.0. See LICENSE for the details.

# Packages

No description provided by the author