Skip to main content

git-epic

A Python CLI for epic-based Git workflows, with no runtime Python dependencies. Git discovers the git-epic executable automatically, so commands use git epic ….

Install

Requires Python 3.11+, Git 2.31+, and glab. Authenticate once with your GitLab host:

glab auth login --hostname gitlab.example.com

Replace gitlab.example.com with your GitLab host, such as gitlab.com.

Install with uv. On macOS, install uv with brew install uv if needed. After the first PyPI release:

uv tool install git-epic
uv tool update-shell
git epic -h

For local development before publication:

uv tool install --editable .
uv tool update-shell
git epic -h

Run the local installation commands from this repository. The editable install picks up Python source changes immediately. Use uv tool install --force --editable . to replace an existing installation with the editable version.

If uv tool update-shell changes your PATH, open a new terminal. Upgrade a PyPI installation with uv tool upgrade git-epic. Until the package is published, install from a local checkout. uv manages the tool's isolated Python environment.

Commands

Use git epic -h for CLI help. Git reserves git epic --help for a system manual page; this MVP does not install one. Direct invocation also supports git-epic --help.

Command Behavior
git epic init Write shared .git-epic.json; defaults to production, origin, and GitLab.
git epic start <name> Fetch production; create and switch to local epic/<name>.
git epic task start <name> From an epic, fetch and fast-forward remote epic changes if possible; create task/<epic>/<name>.
git epic task sync From a task, fetch and merge its remote parent epic; use the local parent if unpublished. Push the result yourself or with task submit.
git epic task submit Push committed task changes; create or return its parent epic MR. Publish the local parent epic if it is not yet on the remote.
git epic hotfix start <name> Fetch production; create and switch to local hotfix/<name>, independently of any epic.
git epic hotfix submit Push committed hotfix changes; create or return an MR targeting production. Never merges or deploys.
git epic sync From an epic or hotfix, fetch and merge production. Push the result yourself or with its submission command.
git epic status Fetch; show current task/epic/hotfix, labelled local/remote candidate drift, related open MRs (including task MRs when on an epic), and their latest reported CI status.
git epic release Push committed epic changes; create or return an MR targeting production. Never merges or deploys.

GitLab calls PRs merge requests (MRs). Submission commands also push new commits when returning an existing MR; they do not create a duplicate.

Names are single segments: letters, numbers, dots, underscores, and hyphens, starting with a letter or number. Git's branch-name restrictions also apply.

For repositories using a different production branch or remote:

git epic init --production main --remote origin
git add .git-epic.json
git commit -m "Configure git-epic"
git push

Commit this file on production before creating epics so all branches and teammates inherit it. It contains no credentials. Existing configuration is never overwritten; edit the file to change settings. An initial production commit must already exist on the remote; init does not bootstrap an empty application repository.

Typical workflow

git epic start checkout
git epic task start payment
# Implement and commit your task.
# Bring in updates from the parent epic while working.
git epic task sync
git epic task submit
# Review, CI, and merge the task MR in GitLab.
git switch epic/checkout
# Bring merged tasks into the local epic.
git fetch origin
git merge --ff-only origin/epic/checkout
git epic sync
git push origin epic/checkout
# Validate the release candidate using your project's testing and review process.
git epic release
# Review, run required CI, and merge in GitLab.

Deployment and release approval are managed outside this CLI. Validate the exact commit/build intended for release. If the candidate or production changes, update and revalidate before merging. release refuses an epic that is behind current production, but the hosting platform/CI must also enforce release checks at merge time. The CLI does not record or verify release approval.

Hotfix workflow

A hotfix branches directly from production and returns to production through an MR:

git epic hotfix start login-fix
# Implement and commit the fix on hotfix/login-fix.
git epic status
git epic hotfix submit
# Review, run required CI, and merge the MR in GitLab.

hotfix start always uses the latest fetched production, even when invoked from an epic or task branch. It creates no parent epic and does not publish the branch until submission. hotfix submit requires a hotfix/<name> branch and reuses an existing open MR while pushing any new commits. Empty submissions are rejected.

Like an epic release, a hotfix must include current production before submission. If production has advanced, run git epic sync, resolve any conflicts, and revalidate the fix before retrying git epic hotfix submit. After the MR merges, sync active epics with production so they include the fix. Hotfix branches use the existing repository's configured production branch and remote.

Git behavior

  • Branch and submission operations require a clean working tree and no unfinished merge/rebase/cherry-pick/revert. status allows uncommitted changes.
  • Fetch updates remote-tracking refs. No command force-pushes, resets, deletes a branch, merges an MR, or deploys.
  • start creates a local epic. Submission publishes branches with ordinary pushes; non-fast-forward pushes are rejected rather than overwriting teammates' work.
  • task start stops if local and remote epic histories have diverged. Reconcile the epic using Git before retrying. release similarly requires your local epic to include remote epic work before a push can succeed.
  • task sync uses the remote parent epic when published, even if the local epic has additional unpushed commits. If neither parent exists, restore or publish it first.
  • If sync or task sync conflicts, resolve and commit, or use git merge --abort.
  • An MR/API failure after a push leaves the branch published; retry the command.
  • GitLab authentication is managed by glab, and Git authentication by Git.

Development and release

uv sync --extra dev --python 3.11
uv run --extra dev ruff check .
uv run --extra dev ruff format --check .
uv run --extra dev python -m unittest discover -s tests -v
uv run --extra dev python -m build --installer uv
uv run --extra dev python -m twine check --strict dist/*.whl dist/*.tar.gz

Tests create temporary local Git repositories and a fake glab; they never create real MRs or touch production. GitLab API behavior is delegated to the installed glab. CI checks Python 3.11 and 3.14, builds a wheel and source distribution, validates metadata with Twine, and smoke-tests the installed wheel via Git.

Publish to PyPI

Local publication helper

From a clean, committed checkout with a configured Git upstream, run:

./publish.sh

The helper uses uv to prompt for a PEP 440 version (press Enter to keep the current version for the first release), update the version and README release-tag examples, run tests, clean and build distributions, validate with Twine, upload to PyPI, and commit/push the release changes. Set PYPI_API_TOKEN or TWINE_PASSWORD in your shell; otherwise Twine prompts for authentication. It does not create a release tag or trigger the CI publication job.

GitLab CI publication

The distribution name is git-epic, import package is git_epic, and CLI entry point is git-epic. Version is defined once in src/git_epic/__init__.py.

  1. Create a PyPI account and an API token. For the first release, a token with account scope is needed; after creating the project, use a project-scoped token.
  2. In GitLab CI/CD variables, add PYPI_API_TOKEN as a masked, protected variable. Protect the release tag pattern (v*) so tagged jobs can access it.
  3. Update the version, then push a matching tag, for example v0.3.0.
  4. After verification and build jobs pass, manually run publish:pypi.

The job uploads only the validated wheel and source distribution from the build job. A release tag must match the package version. PyPI does not allow reusing an uploaded version: use a new version for subsequent releases.

An optional publish:testpypi job uses TESTPYPI_API_TOKEN and the separate TestPyPI registry. TestPyPI accounts and tokens are independent of PyPI. A test installation uses uv tool install --index-url https://test.pypi.org/simple/ git-epic.

For a manual upload of locally built, validated distributions:

export TWINE_USERNAME=__token__
# Set TWINE_PASSWORD to your PyPI API token in your shell.
uv run --extra dev python -m twine upload --non-interactive dist/*.whl dist/*.tar.gz

Credentials are supplied by the shell or CI, never stored in project files. The included release jobs authenticate to PyPI using API tokens. Package-name availability is determined by PyPI at upload time. A public PyPI release includes the source code even when the GitLab repository is private.

Metadata

Release files for git-epic 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-epic 0.3.0
File Size Uploaded Provenance Actions
git_epic-0.3.0.tar.gz 22.8 kB Without provenance Details for git_epic-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for git-epic 0.3.0
File Interpreter ABI Platform Actions
git_epic-0.3.0-py3-none-any.whl Python 3 none any Details for git_epic-0.3.0-py3-none-any.whl

Total release size: 36.2 kB

Release files / git_epic-0.3.0.tar.gz

Download URL git_epic-0.3.0.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1ffde1afc04141ad20a3572cb5ae0c968dcbd955d38c3c3f7bcd005973c6cf79
BLAKE2b-256 checksum
How to use checksums
1d46808f5d7e9d621157da78b8e102ff61567012ba7187d7e082734ae7429905
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / git_epic-0.3.0-py3-none-any.whl

Download URL git_epic-0.3.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a60eb73a902507e5ef0bee2e733ef359b64ad4704a857cc79dcc7986da40ffc
BLAKE2b-256 checksum
How to use checksums
67cc1e68060a2e28fb8efe85df0b5b6924e8eeff446fc413123fd26a02a809f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Security for git-epic 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page