Skip to content

dviramontes/preamble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[pre]amble

preamble is a small workspace helper for git worktrees.

It is designed around a project prefix (default: project) and a workspace root (default: ~/local/work).

pre-amble worktree browser

What it does

  • List numbered worktrees like project-08 with their current branch.
  • Resolve a suffix (e.g. pre 08) to a workspace path.
  • Create the next worktree with pre new from origin/main.
  • Create from another base ref with pre new <branch> (resolved as origin/<branch>).
  • Print/install a zsh wrapper so suffix commands can cd in your shell.

Commands

pre                 # interactive picker in a TTY
pre list
pre 08
pre new
pre new other-branch
pre remove 08 --yes
pre remove 08 --yes --force
pre rm 08 --yes
pre setup
pre setup --install
pre init

Shell integration

The Go binary cannot change the parent shell directory directly.

Use the wrapper installer:

pre setup --install
source ~/.functions.sh

This installs a pre() shell wrapper in ~/.functions.sh so commands like pre 08 navigate correctly.

Configuration

Environment variables:

  • PRE_BASE (default: $HOME/local/work/project)

Example:

export PRE_BASE="${HOME}/local/work/project"

Development

Build and link the binary into ~/go/bin:

just bin

Run locally:

go run ./cmd/pre list

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors