Small bash helpers for everyday development: clean merged git branches, save quick WIP commits, and free up busy ports.
gcb: remove local branches already merged into your target branch (dry-run by default).git-wip: stage everything and create (or amend) lightweight WIP commits.kill-port: find and kill any processes listening on given TCP ports.
- bash (tested on macOS/Linux shells)
- git CLI (
gcb,git-wip) lsof(kill-port)- Ability to create symlinks in
~/.local/bin(default install target)
./install.shWhat it does:
- Creates
~/.local/binif missing. - Warns if
~/.local/binis not onPATH. - Symlinks every executable (non-
.sh) script inscripts/into~/.local/bin.
If ~/.local/bin is not on your PATH, add:
export PATH="$PATH:$HOME/.local/bin"- Dry run (default target is current branch):
gcb- Delete merged branches relative to
main:
gcb -f mainNotes: Skips main/master/develop/dev; fetches/prunes before checking; requires a git repo.
- Save all changes as a WIP commit:
git-wip "tweak auth flow"- Amend the last commit if it was a WIP:
git-wip -a "refine tests"Notes: Stages modified/deleted/untracked files; exits if no staged changes.
- Single port:
kill-port 3000- Multiple ports:
kill-port 3000 8080 5000Notes: Validates port numbers; uses lsof to find PIDs; sends kill -9 to each.
command not found: ensure~/.local/binis on yourPATHand re-source your shell rc.- Git errors: run inside a git repository for
gcb/git-wip; ensuregit fetchworks. - lsof missing: install
lsofvia your package manager. - Permissions: scripts must be executable (
chmod +x scripts/<name>).
See CONTRIBUTING.md for guidelines, development tips, and PR expectations.