A collection of git based subcommands, scripts, and utilities
  • Python 94.1%
  • Shell 3.4%
  • Makefile 2.5%
Find a file
2026-08-11 00:31:21 -04:00
completions/bash Refactored git-workspace to python 2026-08-10 17:34:23 -04:00
src/git_workspace Refactored git-workspace to python 2026-08-10 17:34:23 -04:00
tests Refactored git-workspace to python 2026-08-10 17:34:23 -04:00
.gitignore Refactored git-workspace to python 2026-08-10 17:34:23 -04:00
AGENTS.md Added AGENTS.md 2026-08-11 00:31:21 -04:00
git-new Added project to VCS 2025-11-20 14:34:06 -05:00
Makefile Fixed some issues from rewrite 2026-08-11 00:14:10 -04:00
pyproject.toml Fixed some issues from rewrite 2026-08-11 00:14:10 -04:00
README.md Fixed some issues from rewrite 2026-08-11 00:14:10 -04:00
uv.lock Refactored git-workspace to python 2026-08-10 17:34:23 -04:00

Git Tools

Personal Git tools for common repository workflows.

Tools

  • git-workspace organizes a repository around linked Git worktrees.
  • git-new creates a bare repository with an initial empty commit.

git-workspace

git-workspace organizes a repository around linked Git worktrees. The workspace root contains a bare repository at .git, while each checked-out branch lives in a sibling subdirectory.

project/
|-- .git/          bare common repository
|-- main/          linked worktree
|-- feature-one/   linked worktree
`-- review/        linked worktree

Because the executable is named git-workspace, Git exposes it as git workspace.

Requirements

  • Python 3.11 or newer
  • Git
  • uv, which the Makefile uses for Python tooling

The installed application has no Python package dependencies. Ruff, ty, and pytest are development-only dependencies.

Install

Install all included tools and the Bash completion from the project checkout:

sudo make install

Reinstall after local changes:

sudo make install

Usage

Clone a repository into a workspace:

git workspace https://github.com/example/project.git
git workspace https://github.com/example/project.git local-name

Create a new repository and its initial worktree:

git workspace --new project
git workspace --new project -b topic

Add a worktree from any existing worktree in the workspace:

git workspace -w feature/topic
git workspace -b feature/topic
git workspace -B existing-branch
git workspace -w review -b feature/topic

Branch behavior:

Options Worktree path Branch behavior
-w NAME NAME Reuse NAME, or create it from the invoking HEAD
-b BRANCH BRANCH Create BRANCH; fail if it exists
-B BRANCH BRANCH Reuse BRANCH unchanged, or create it
-w PATH -b BRANCH PATH Create BRANCH at a separate path
-w PATH -B BRANCH PATH Reuse or create BRANCH at a separate path

Existing branches are never reset or moved. A newly created worktree branch starts at the HEAD of the worktree where the command was invoked.

Worktree administrative links are relative, so the complete workspace can be moved as one directory. Git 2.48 and newer handles this natively. Older versions use a portable Python fallback that rewrites both sides of the worktree link.

Development

Create the development environment:

make sync

Run all checks:

make check

Run individual checks or format the code:

make format
make lint
make typecheck
make test

Build release artifacts with:

make package

Use make dist to build only the source distribution.

git-new

Create a bare repository with an initial empty commit:

git-new project.git