Skip to main content

mgit

A small companion for humans who like tidy git checkouts.

Version on pypi Tested with Github Actions Python versions tested

What it is

mgit is a tiny CLI for people who like their git checkouts clean, current, and easy to scan. It gives you a quick read on one repo, or on every repo directly inside a workspace folder.

  • What state did I leave this checkout in?

  • Can I pull, or did I leave work pending here?

  • Is a merged branch still hanging around, waiting to be cleaned?

  • I just wrapped up a branch; can I safely get back to main and clear it away?

mgit is not a git replacement. It is the compact, careful layer for those ordinary moments where you would rather see the answer than reconstruct it from a handful of commands.

The rhythm

Start with a glance:

mgit        # show status here, or across a workspace

Refresh or move forward only when you mean to:

mgit f      # fetch --all --prune, then show the refreshed status
mgit p      # pull --rebase, but never over pending work

And for the wonderfully common PR merged moment:

mgit g      # fetch, return to the default branch, pull, clean this branch

The short names are the intended interface:

  • status / s: show whether anything here needs attention. This is the default.

  • fetch / f: refresh remote refs, then show what changed.

  • pull / p: pull with rebase only when pending work will not be disturbed.

  • main / m: checkout the default branch, even if it is master.

  • branches / b: list local branches with presence and cleanup annotations.

  • legend / l: explain status and branch symbols.

  • groom / g: safely finish with the merged branch you are currently on.

The command shape is:

mgit [-v] [--color auto|always|never] [COMMAND] [FOLDER]

You can pass a folder to most commands:

mgit ~/github
mgit f ~/github
mgit g ~/github/mgit

Workspace scans are shallow on purpose: mgit ~/github inspects direct children like ~/github/*/.git and does not crawl nested folders.

What you see

A workspace stays pleasantly skimmable:

    mgit: main ✅
 pickley: main ☑️ [+1🪦] ⌛4w 6d
   runez: feature 🪦 ✏️1
detached: HEAD 👻

In one glance you get:

  • the current branch

  • local diffs and untracked files

  • ahead/behind/gone tracking state

  • fetch freshness

  • a compact hint that a stale local branch is still lurking

✅ means recently refreshed, ☑️ means the local picture may be older, ⌛ calls out notably stale fetch information, a branch-level 🪦 means the branch has been proven cleanable, and 👻 means detached HEAD. A bracket such as [+2🪦+1] says that, besides the current and default branches, two local branches have been proven cleanable and one remains.

The branch list spells that state out when you need to decide what is done:

mgit b
  commands-instead-of-flags💾☁️🪦 [cleanable]
  main                            [default]
* more-cleanup💾                  [current]
  v2gpt💾☁️

Run mgit legend for the symbol key, or mgit b --legend to append it below the branch listing.

💾 means the branch is local and ☁️ means its configured upstream is still present in the fetched remote refs. 🪦 [cleanable] appears only when the local branch, and any shown upstream ref, is already merged into the default branch or is content-equivalent after a squash merge. An unpublished branch carrying new work therefore appears as 💾 rather than looking abandoned.

For a single checkout, status also prints the pending paths. Workspace output keeps to one line per repo, so you can keep checking a directory full of projects without turning the terminal into a log dump:

mgit ~/github/mgit

Color is automatic on terminals and can be controlled explicitly:

mgit --color auto
mgit --color always
mgit --color never

Safety model

mgit is read-only by default. Asking how things look does not change your repos.

Commands that act are explicit:

  • mgit f updates local remote refs with git fetch --all --prune.

  • mgit p pulls with rebase only when the checkout passes safety checks.

  • mgit g fetches, verifies that the current branch can be cleaned before switching branches, pulls safely, and deletes that local branch only. If it still exists on origin, it deletes that one remote branch only after independently proving that the fetched remote ref is merged or content-equivalent to the fetched default branch; an exact-ref lease prevents deleting a branch that advanced meanwhile. No other branch is deleted. When already on the default branch, it fetches and reports that fact without pulling or cleaning branches. Use mgit m when you only want to switch to the default branch.

Coming next

A larger convenience waiting in the wings is mgit clone: give it a full repo URL and let mgit choose the local destination from simple config rules.

Planned config shape:

locations = [
    { match = "github.com/zsimic/*", dir = "~/github" },
    { match = "github.com/*",        dir = "~/ext" },
    { match = "git.mycompany.com/*", dir = "~/dev" },
]

The goal is predictable placement without memorizing where each family of repos belongs. Status, fetch, pull, main, and groom do not require any mgit config.

Install

Install with pickley or pipx:

pickley install mgit

or:

pipx install mgit

To work on mgit itself, see contributing.

Metadata

Release files for mgit 2.1.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 mgit 2.1.0
File Size Uploaded
mgit-2.1.0.tar.gz 32.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mgit 2.1.0
File Interpreter ABI Platform
mgit-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.4 kB

Release files / mgit-2.1.0.tar.gz

Download URL mgit-2.1.0.tar.gz
Size 32.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4f5f6eaed768077b902553362eb6575f5e3813285b51b6de93fcaa48448a47c3
BLAKE2b-256 checksum
How to use checksums
0f5a7f921ad1e6a0d174b11466871ac8ef250c31e8466c702afb98e47496dbf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / mgit-2.1.0-py3-none-any.whl

Download URL mgit-2.1.0-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa301b3f1a1eaa6bb6136f765dae9eb3041595f413e10a67bb2fac04873ccb11
BLAKE2b-256 checksum
How to use checksums
9284f9af5ddf05291c4ff9b1862ec6649032de926d81924d0d1af4833b1073e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.3

2 release files

1.0.2

2 release files

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