Configuration

Customize gh-wt to fit your workflow.

Configuration File

gh-wt reads configuration from ~/.config/gh-wt/config.yaml.

worktree_dir: "~/github/worktree"

actions:
  - name: tmux
    cmds:
      - tmux new-session -d -s {{.BranchName}}
      - tmux send-keys -t {{.BranchName}} "cd {{.WorktreePath}}" C-m

Configuration Options

Option Type Description Default
worktree_dir string Directory where worktrees are created ~/github/worktree
actions array List of post-creation actions []

Environment Variables

Configuration can also be set via environment variables:

Variable Description
GH_WT_WORKTREE_DIR Override worktree directory
GH_WT_VERBOSE Enable verbose output
GH_WT_NO_COLOR Disable color output

Priority Order

Configuration priority (highest to lowest):

  1. Command-line flags
  2. Environment variables (prefix: GH_WT_)
  3. Configuration file
  4. Default values