gitx is an opinionated Git helper focused on:
- Branch workflows (
feature/bugfix/hotfix/release/docs/ci/experiment) - Cleanup, pruning, and branch hygiene
- Reporting / summaries / changelogs / worklogs
- Stash & WIP management
- Interactive commit helpers
- Light repo “doctor” and hook bootstrap
- Author/code-level analytics (surviving code %, blame-heavy vs lite modes)
It never hides Git – it just wires composable commands into practical workflows.
sudo curl -fsSL "https://raw.githubusercontent.com/infocyph/Toolset/main/Git/gitx" \
-o /usr/local/bin/gitx && sudo chmod +x /usr/local/bin/gitxgitx <command> [arguments]If you call gitx with no or unknown command, it prints a categorized help with all commands.
For commands that accept date windows (YYYY-MM-DD YYYY-MM-DD), gitx resolves the window to:
- start_ref = first commit in the window (chronological)
- end_ref = last commit in the window (newest)
Then it runs the same logic as commit/tag ranges. This keeps outputs consistent across repos and avoids off-by-one issues.
| Command | Description |
|---|---|
status |
Show repository status, branch tracking info, and remotes |
fetch |
Fetch remote branches and prune stale references |
sync |
Sync alpha / develop (and optional branches) from main branch |
create <type> <name> |
Create a new branch from main (feature|bugfix|hotfix|release|docs|ci|experiment) |
merge <source> <target> |
Merge source branch into target branch |
reset-branch |
Reset current branch to origin/<branch> (soft / hard / dry-run) |
prune |
Prune remote branches and delete local branches tracking : gone] remotes |
cleanup |
Delete branches already merged into main (excluding core branches) |
orphan-branches [days] |
List and optionally delete unmerged branches older than N days (default 30) |
compare [branch1] [branch2] |
Compare two branches (commits + changed files) |
tag <version> |
Create and push an annotated tag (e.g., v1.2.3) |
initial-commit |
Show the initial commit hash |
latest-tag |
Show the latest tag in the repo |
| Command | Description |
|---|---|
commit |
Interactive commit helper (numbered file selection + message) |
amend |
Amend last commit message (inline or interactive) |
unstage |
Unstage all files in the index (with confirmation) |
cherry-pick |
Interactive cherry-pick by selecting commits from a numbered list |
revert |
Interactive revert (select commits; per-commit or amend mode) |
diff [output_file] |
Staged diff viewer/saver OR range/date diff (see notes) |
apply-patch <patch_file> [...] |
Apply a patch file (with --check, --3way, --index, --reverse) |
log-file <path> |
Show commit history or diffs for a specific file |
count-changes <start> [end] |
Show shortstat (files/insertions/deletions) between two commits |
list-changes <branch1> <branch2> |
List files changed between two branches |
stage-deleted |
Stage all deleted files |
stage-deleted-dir <directory> |
Stage deleted files under a specific directory |
| Command | Description |
|---|---|
summary [range] [include-all] [mode] |
Per-author summary with surviving-code %, heavy or lite mode |
summary <start_date> <end_date> [include-all] [mode] |
Same, but for a date window (YYYY-MM-DD) |
summarize [short] |
Repository summary (branches, tags, contributors, size, etc.) |
commit-report <range> |
Author-based Markdown commit report for a commit range |
commit-report <start_date> <end_date> |
Author-based report for a date window (YYYY-MM-DD) |
worklog <range> |
CSV worklog for a commit range (per commit row) |
worklog <start_date> <end_date> |
CSV worklog for a date window (YYYY-MM-DD) |
report <start> [end] [outfile] |
PR / merge / standalone commit report for a commit range |
report <start_date> <end_date> [outfile] |
Same, but for a date window (YYYY-MM-DD) |
changelog <start> <end> |
Changelog between two commits/tags |
changelog <start_date> <end_date> [file] |
Changelog for a date window (YYYY-MM-DD) |
| Command | Description |
|---|---|
stash |
Interactive stash manager (save / list / apply / pop / drop / rename / clear) |
stash save [msg] |
Save changes to stash with optional message |
stash list |
List all stashes |
stash apply <n> |
Apply stash@{n} |
stash pop <n> |
Pop stash@{n} |
stash drop <n> |
Drop stash@{n} |
stash rename <n> <name> |
Rename stash@{n} to a new name (multi-word supported) |
stash clear |
Delete all stashes |
wip <save|list|pop|apply|clear> |
Opinionated WIP helper on top of stash |
clean [--force] |
Clean untracked files/dirs (interactive by default; --force to skip prompts) |
large-files |
Show or save the largest Git-tracked blobs (by size) |
| Command | Description |
|---|---|
add-remote <name> <url> |
Add a new remote |
push-remote <remote> <branch> |
Push a specific branch to a specific remote |
pull-remote <remote> <branch> |
Pull a specific branch from a specific remote |
config |
Interactive Git configuration editor (global) |
set-lf |
Configure Git to prefer LF line endings (core.autocrlf=false) |
doctor |
Repository health check (upstream, changes, stashes, .git size, big blobs) |
hooks init |
Install Git hook templates (prepare-commit-msg, pre-commit, pre-push) |
self-update |
Update gitx from GitHub (with backup + hash check) |
gitx tag v1.0.0
gitx tag 1.0.0 # also accepted (will create tag "1.0.0")-
Creates an annotated tag:
git tag -a <version> -m "Release <version>"
-
Pushes the tag:
git push origin <version>
-
Refuses to overwrite existing tags.
gitx statusShows:
git status -sb --untracked-files=all- Upstream ahead/behind counts (
git rev-list --left-right --count @{upstream}...HEAD) or a note if no upstream - Remotes in compact
remote -> URLform
gitx fetch- Ensures we’re in a Git repo
- Runs:
git fetch --prune - Good pre-step before prune/cleanup/summary.
Several commands auto-detect the main branch using:
origin/HEADsymbolic reforigin/mainorigin/trunk- Fallback:
master
All “main” references below use that detection.
gitx sync-
Detects main branch.
-
Updates main:
git checkout <main> && git pull origin <main>
-
Merges main into:
alphadevelop- Additional comma-separated branches you optionally enter interactively.
-
For each branch:
git checkout <branch> git merge --no-ff <main> git push origin <branch>
Branches that don’t exist locally are skipped with a message.
gitx create feature merchant-fy-summary-
Types:
feature,bugfix,hotfix,release,docs,ci,experiment. -
Branch name:
<type>/<name>(e.g.,feature/merchant-fy-summary). -
Steps:
- Detect main branch.
- Checkout main and pull latest.
- Create new branch from main.
- Push to origin.
If the branch already exists locally, it aborts with an error.
gitx merge feature/fy-summary main-
Validates both branches exist.
-
Confirms before merging.
-
Flow:
git checkout <target> git pull origin <target> git merge --no-ff <source> git push origin <target>
-
On merge conflicts:
- Notifies you about conflicts
- Instructs you to resolve manually (
git status,git add,git commit) orgit merge --abort.
gitx reset-branch-
Operates on current branch.
-
Requires
origin/<branch>to exist. -
Menu:
-
Soft reset – keep local changes, reset only HEAD:
git fetch origin git reset --soft origin/<branch>
-
Hard reset – discard all local changes (with confirmation):
git fetch origin git reset --hard origin/<branch>
-
Dry-run – preview diff vs
origin/<branch>:git fetch origin git diff --stat origin/<branch>
-
gitx prune-
Runs:
git fetch --prune
-
Detects local branches whose upstream shows
: gone]ingit branch -vv. -
Offers:
- Delete all such branches at once, or
- Confirm deletion per-branch.
gitx cleanup-
Lists branches merged into main (excluding
master,main,develop,alpha). -
Options:
- Delete all merged branches at once.
- Or confirm deletion one by one.
gitx orphan-branches # default: 30 days
gitx orphan-branches 60-
Detects main branch.
-
Scans all local branches:
- Skips core branches (
master,main,develop,alpha,trunk). - Skips branches already merged into main.
- Computes age (in days) from last commit timestamp.
- Skips core branches (
-
Lists branches not merged into main and older than N days.
-
Then offers:
- Delete all of them, or
- Delete selected names.
gitx compare # current vs main (prompts if omitted)
gitx compare develop main-
Output:
-
Commits unique to
branch2:git log --oneline branch1..branch2
-
Files changed between branches:
git diff --name-only branch1..branch2
-
gitx initial-commit
gitx latest-tag-
initial-commit:git rev-list --max-parents=0 HEAD
-
latest-tag:git describe --tags --abbrev=0
If no commits/tags exist, prints a friendly error.
gitx commitWorkflow:
-
If no changes: prints “No changes to commit.”
-
Shows
git status -swith numbered lines. -
Prompt:
a→ stage all.- Or e.g.
1,3,5→ stage selected files.
-
Shows staged files (
git diff --cached --name-only). -
Prompts for commit message.
-
Runs
git commit -m.
gitx amend-
Asks for a new commit message:
- If blank: runs
git commit --amend(opens editor). - Otherwise:
git commit --amend -m "<new message>".
- If blank: runs
gitx unstage-
Warns this will unstage all files.
-
Asks for confirmation.
-
Runs:
git reset --staged .
gitx cherry-pick-
Shows recent commits as a numbered list.
-
You enter a comma-separated list of numbers (
1,4,5). -
For each commit (in order):
git cherry-pick <hash>
-
On conflict: you choose
resolvemanually orabort(git cherry-pick --abort).
gitx revert-
Same numbered list of recent commits.
-
You select commit numbers.
-
Then choose mode:
- Revert with normal commits:
git revert <commit>
- Revert & amend last commit:
git revert --no-commit <commit1> ... git commit --amend -m "Amended revert: <previous message>"
- Revert with normal commits:
gitx diff supports two modes:
- Staged diff (existing behavior)
gitx diff
gitx diff staged.patch- No args: prints staged diff (
git diff --cached). - With a single file: confirms overwrite if exists, then writes staged diff to that file.
- Range/date diff (new)
# Date window → defaults to --stat output (prints to stdout)
gitx diff 2025-12-14 2025-12-24
gitx diff 2025-12-14 2025-12-24 --name-only
gitx diff 2025-12-14 2025-12-24 --stat
# Refs (commit/tag/branch)
gitx diff v1.0.0 v1.1.0
gitx diff cc08511 d5305c7 --name-onlyNotes
-
Runs with no pager (uses
git --no-pager diff). -
Default mode for range/date diff is
--stat(when you provide<start> <end>with no flags). -
--stat/--name-onlyprint to stdout (so redirection works):gitx diff 2025-12-14 2025-12-24 --stat > diff_stat.txt gitx diff 2025-12-14 2025-12-24 --name-only > files.txt
-
--patchsaves to a file by default:gitx diff 2025-12-14 2025-12-24 --patch gitx diff 2025-12-14 2025-12-24 --patch changes.patch
Default filename:
diff_<start>_to_<end>.patch -
Limit the diff to paths using
--:gitx diff 2025-12-14 2025-12-24 --stat -- app/ routes/ gitx diff v1.0.0 v1.1.0 --patch -- src/
Applies a patch generated by gitx diff ... --patch (or any compatible unified diff).
gitx apply-patch changes.patch
gitx apply-patch changes.patch --check
gitx apply-patch changes.patch --index
gitx apply-patch changes.patch --3way
gitx apply-patch changes.patch --reverseFlags:
--check– validate patch applies cleanly (no changes made)--index– apply and stage (updates index)--3way– attempt a 3-way merge fallback if patch does not apply cleanly--reverse– unapply/revert a patch
gitx log-file src/Service/Payment.php-
Menu:
-
Commit history:
git log --follow --pretty='%h - %s (%an, %ad)' --date=short -- <file>
-
Diffs:
git log --follow -p -- <file>
-
gitx count-changes v1.0.0 v1.1.0
gitx count-changes HEAD~50- Default
end=HEAD. - Prints
git diff --shortstat <start> <end>.
gitx list-changes main develop- Prints
git diff --name-only branch1 branch2.
gitx stage-deleted
gitx stage-deleted-dir src/- Stages deleted files tracked by Git.
gitx summary
gitx summary HEAD~50 include-all heavy
gitx summary 2025-01-01 2025-01-31 lite-
Modes:
heavy(default): runsgit blameto compute surviving code share per author.lite/fast/no-blame: skips blame; Surviving Code % isN/A.
gitx commit-report v1.0.0..v1.1.0
gitx commit-report 2025-01-01 2025-01-31- Outputs Markdown grouped by author.
gitx worklog v1.0.0..v1.1.0
gitx worklog 2025-01-01 2025-01-31 >worklog-2025-01.csv-
Outputs CSV:
Author,Email,CommitId,Type,DateTime,Subject,Body
gitx report v1.0.0 v1.1.0
gitx report 2025-01-01 2025-01-31 pr_report_jan.txt-
Sections:
- PR merges (subjects contain
"Merge pull request") - Non-PR merges
- Standalone commits not inside merges
- PR merges (subjects contain
gitx changelog v1.0.0 v1.1.0
gitx changelog 2025-01-01 2025-01-31 changelog_jan.txt-
Produces a
changelog_*.txtfile with lines:<hash> - <subject> (<author>, <date>)
gitx stash
gitx stash save "Before refactor"
gitx stash rename 0 "WIP: dashboard refactor"renamesupports multi-word names.
gitx wip save "experimenting with API"
gitx wip list
gitx wip popgitx hooks initCreates hook templates in .git/hooks:
prepare-commit-msg.gitxpre-commit.gitxpre-push.gitx
Optionally activates them by copying without .gitx.
gitx self-updateDownloads latest script from GitHub, compares SHA-256, backs up and replaces if newer.
gitx status
gitx fetch
gitx sync
gitx create feature merchant-fy-summary
gitx merge feature/merchant-fy-summary main
gitx tag v1.0.0
# Range/date diff
gitx diff 2025-12-14 2025-12-24
gitx diff 2025-12-14 2025-12-24 --name-only
gitx diff 2025-12-14 2025-12-24 --patch
gitx apply-patch diff_2025-12-14_to_2025-12-24.patch --check
gitx report 2025-01-01 2025-01-31
gitx changelog v1.0.0 v1.1.0
gitx summary HEAD~100 include-all heavy
gitx worklog 2025-01-01 2025-01-31 >worklog-2025-01.csv
gitx doctor
gitx hooks init
gitx self-update
gitx large-files