grove

command module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 11 Imported by: 0

README

Grove

Grove is a wrapper around the git worktree command.

Grove takes the approach of "every branch should have it's own worktree".

Features

Installation

go install github.com/jacobdrury/grove@latest

Usage

# Initialize grove in your repository
grove init

# Checkout a worktree
grove checkout <branch-name>

All other commands are automatically forwarded to git worktree.

grove prune # gets run as 'git worktree prune'

Configuration

The Grove configuration file is located in .grove/config.yaml within your repository root.

# The directory in which worktrees will be stored.
worktrees-directory: ./worktrees

# Used to resolve branch names
branch-resolver:
    branch-delimiter: /
    prefix-aliases: {}

# Commands to run during different events.
hooks:
    shell: C:\WINDOWS\system32\cmd.exe
    after-checkout: []

Hooks

Grove supports a variety of hooks that will run the listed commands when the corresponding event is triggered. All commands will be run with the configured shell.

hooks:
    shell: C:\WINDOWS\system32\cmd.exe
    after-checkout:
        - quick-build

The above config will run the quick-build command within the new worktree directory after it's been checked out.

Worktree Seeding

In the .grove directory you will find a seed directory. This directory contains files that you wish to seed new worktrees with when they are created. The directory structure found within the seed directory will be maintained when the worktree is seeded.

Branch Name Resolution

Branch names can be resolved using custom 'prefix aliases' configured in .grove/config.yaml.

branch-resolver:
    branch-delimiter: /
    prefix-aliases:
        f: feature
        c: chore

With the above configuration, the following would be true:

grove checkout f/some-feature # would checkout `feature/some-feature`

This will also perform slug resolution.

git checkout -b feature/1234-example # create a new branch
grove checkout f/1234                # resolves to `feature/1234-example`

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
internal
git

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL