A friendly, single-file Windows batch front-end for Git — turning intimidating commands into guided, plain-English actions.
Git Manager is a self-contained .bat script that wraps everyday Git workflows behind a clean, numbered menu. Double-click it from anywhere inside a repo (or any subfolder) and it walks you through saving, syncing, branching, releasing, undoing mistakes, and even resolving merge conflicts — without ever needing to memorize a single Git flag.
- Zero install. One file. No dependencies beyond Git for Windows + built-in PowerShell.
- Self-relocating. Copies itself to
%TEMP%on launch so it never locks the repo folder. - Auto-finds the repo root. Walks up the directory tree until it finds
.git. - Plain-language menus. "Save and upload", "Get latest updates", "Start a new task" — not
push,pull,checkout -b. - Smart conflict resolver. Bundled PowerShell engine auto-resolves whitespace-only, identical, empty-side, and same-author conflicts, then walks you through anything left.
- Safe by default. Automatic stashing,
--force-with-leasebefore--force, backups before every conflict rewrite, and confirmation prompts on destructive actions. - Network resilience. Push/pull/fetch operations retry up to 3 times with backoff.
- Make sure Git for Windows is installed and on
PATH. - Drop
manage-git.batanywhere — desktop, a tools folder, or directly inside your repo. - Double-click it, or run it from any folder inside a Git repository:
manage-git.bat
- Pick a number. That's it.
The script copies itself to
%TEMP%and re-launches from there, passing your original folder as its working directory. This means you can update the source.batfile even while it's running.
The main menu groups every operation into 12 categories:
| # | Category | What it covers |
|---|---|---|
| 1 | Quick Actions | One-shot combos: sync, update, new task, finish task, release, PR review, undo last commit, split a big commit, identity setup |
| 2 | First Time Setup | Configure user, init / clone, set up remotes |
| 3 | Branches | Create, switch, list, rename, delete, track remote branches |
| 4 | Saving Changes | Stage, commit, amend, partial saves, stash management |
| 5 | Sync | Pull, push, fetch, force-with-lease, set upstream |
| 6 | History | Logs, file history, blame, status, diffs |
| 7 | Merging | Merge branches, rebase, cherry-pick, with safety prompts |
| 8 | Undo | Revert, reset (soft / mixed / hard), restore files, drop a specific commit |
| 9 | Versions | Tags, releases, annotated tags, push tags |
| 10 | Subprojects | Submodule add / update / sync / deinit |
| 11 | Advanced | Reflog, gc, prune, low-level plumbing |
| 12 | Help — Resolve Conflicts | The smart conflict resolver (see below) |
When a merge, pull, rebase, or cherry-pick stops on conflicts, option [12] (or any flow that detected a conflict) launches the bundled resolver. It is a PowerShell engine embedded directly in the .bat (lines prefixed :::PS_RES:::) and extracted to %TEMP% at runtime.
For every <<<<<<< / ======= / >>>>>>> block it runs these checks in order:
- Identical blocks — both sides made the same edit → keep one.
- Both sides empty → drop the whole block.
- One side empty → keep the non-empty side.
- Whitespace-only difference → keep ours.
- Same author, both sides → keep the newer commit's version (uses
git logtimestamps). - Safe-concat for text formats (
.gitignore,.env,.txt,.md) → deduplicated union of both sides.
Anything that can't be auto-resolved is shown side-by-side with these choices:
[1] Keep TOP block only
[2] Keep BOTTOM block only
[3] Keep BOTH: Top then Bottom
[4] Keep BOTH: Bottom then Top
[5] Open file in default editor
After each file, a colored git diff preview lets you Stage or Revert before moving on.
From the file picker you can also:
- Type
Ato keep TOP for every remaining file - Type
Bto keep BOTTOM for every remaining file - Type
ABORTto restore every backup and auto-detect & abort the underlying operation (merge --abort,rebase --abort,cherry-pick --abort,revert --abort)
- Every file is
.bak-backed before being touched. - If the resolver would leave any unresolved markers in the output, it refuses to claim success and the original is restored.
- BOMs, mixed line endings (
CRLF/LF/CR), and unterminated conflict blocks are detected and handled without silently corrupting the file.
- Conflict-marker rewrite reliability. Previously, files with a UTF-8 BOM on the first line, stray
\rcharacters at line ends, or unterminated conflict blocks could cause the parser to skip the opening<<<<<<<marker while still consuming the trailing>>>>>>>line as content — leaving a half-rewritten file. The parser now:- reads the file as raw bytes and strips the BOM explicitly,
- detects markers with anchored regex (
^<{7}(\s|$),^={7}(\s|$),^>{7}(\s|$),^\|{7}(\s|$)) so trailing whitespace and CR characters can't fool it, - flushes any in-flight conflict block when a new marker or EOF arrives unexpectedly,
- verifies the output is fully marker-free before declaring success (otherwise it returns exit
2so the caller restores the backup), - preserves the original line endings and BOM when writing the resolved file.
- Windows with
cmd.exe - Git for Windows (
gitonPATH) - Windows PowerShell 5.1+ (ships with Windows 10 / 11)
- You can run the script from any subfolder of a repo — it walks up until it finds
.git. - It also works fine for submodules: launch it from inside the submodule and it'll treat that as the repo root.
- For force-push protection, the script always tries
--force-with-leasefirst and only falls back to--forceafter an explicit confirmation. - Network ops (
push,pull,fetch) auto-retry up to 3 times with a 3-second backoff.
See LICENSE.