Expand description
Git operations.
Validates git repositories, lists branches, creates and removes worktrees, and derives worktree directory names from project and branch names.
Structs§
- Worktree
Creation - Result of creating a worktree, including whether the branch was newly created.
Functions§
- assume_
unchanged - Marks a file as assume-unchanged in git’s index.
- check_
uncommitted_ specs - Checks for uncommitted changes in spec directories or files.
- create_
worktree - Creates a git worktree for
branch. - current_
branch - Returns the short name of the current branch (e.g., “main”, “feat/add-auth”).
- default_
branch - Returns the name of the default branch (usually “main” or “master”).
- delete_
branch - Deletes a branch.
- exclude_
from_ git - Excludes a file from git tracking by adding it to
.git/info/exclude. - list_
branches - Lists all branches (local and remote), deduplicated, sorted, with remote prefixes stripped.
- merge_
branch - Merges the specified branch into the current branch.
- project_
name - Returns the name of the project (directory name of the git repository).
- prune_
worktrees - Prunes stale worktree registrations from the git worktree list.
- remove_
worktree - Removes the worktree at the given path.
- validate_
repo - Validates that the given path is inside a git repository.
- worktree_
dir_ name - Derives a worktree directory name from project and branch names.