Personal Git configuration and utilities for cross-machine synchronization.
Current Version: v0.1.0-pre | Changelog
Requirements: macOS 12+, Homebrew, Python 3
git clone https://github.com/J-MaFf/gitconfig.git ~/Documents/Scripts/gitconfig
cd ~/Documents/Scripts/gitconfig
bash scripts/unix/install.sh --force(Optional) Enable SSH commit signing with 1Password:
brew install 1password-cli
bash scripts/unix/install.sh --forceRequirements: PowerShell 5.1+, Administrator privileges, Python 3
git clone https://github.com/J-MaFf/gitconfig.git ~/Documents/Scripts/gitconfig
cd ~/Documents/Scripts/gitconfig
& ".\scripts\windows version\install.ps1" -ForceRequirements: bash, Python 3, cron (optional, for auto-update)
git clone https://github.com/J-MaFf/gitconfig.git ~/Documents/Scripts/gitconfig
cd ~/Documents/Scripts/gitconfig
bash scripts/unix/install.sh --forcemacOS and Linux share one set of scripts in scripts/unix/; they detect the OS. The older scripts/mac version/ and scripts/linux version/ commands still work: they run the same scripts and refuse to run on the other OS. Pass --no-scheduler to skip the auto-update job (--no-launchd and --no-cron still work too).
The setup script handles generating ~/.gitconfig from the template, creating symlinks, installing the rich Python dependency, and registering an auto-update job (launchd on macOS, Task Scheduler on Windows, cron on Linux).
The auto-update job is pull + install + prune: at each login it pulls the latest commits and, if .gitconfig.template changed in that pull, regenerates ~/.gitconfig so template changes take effect without a manual re-run. It also prunes merged branches in the gitconfig repo — dropping stale remote-tracking refs (fetch --prune) and deleting local branches whose remote has been deleted — so old feature branches don't pile up. It also ensures the optional textual dependency (which powers the interactive git alias browser) is installed — best-effort and only when missing, so existing machines pick it up on their next update without a manual pip install. Your existing ~/.gitconfig is backed up first, and ~/.gitconfig.local is never modified. Run the same pull-install-prune on demand any time with git selfupdate.
Put your own git settings in ~/.gitconfig.local, not ~/.gitconfig. ~/.gitconfig is generated from .gitconfig.template and is rewritten whenever the template changes. Before a rewrite, the scripts print the names (never the values) of any settings in ~/.gitconfig that the template doesn't have, so you can move them.
Whenever a script replaces or removes one of your files, it first saves a timestamped copy next to it, for example ~/.gitconfig.bak.20261003-142501. The newest 5 backups of each file are kept and older ones are deleted. Set GITCONFIG_BACKUP_KEEP to change the limit, or set it to 0 to keep every backup. Older *.bak files from previous versions (~/.gitconfig.bak, ~/Existing.*.bak) are never touched. Symlinks that already point into this repo aren't backed up, so running the installer again doesn't create new backups.
Running the installer again is safe. It doesn't remove anything first. To wipe the previous install before setting up again, pass --reinstall (bash) or -Reinstall (PowerShell). Everything it removes is backed up first.
Each platform has a cleanup script that removes symlinks, local config, and the auto-update job.
bash scripts/unix/cleanup-gitconfig.shRemoves: ~/.gitconfig, ~/.gitignore_global symlink, ~/gitconfig_helper.py symlink, ~/.gitconfig.local, and the launchd login agent.
& ".\scripts\windows version\Cleanup-GitConfig.ps1"Removes: ~/.gitconfig, symlinks, ~/.gitconfig.local, and the GitConfig Pull at Login scheduled task.
bash scripts/unix/cleanup-gitconfig.shRemoves: ~/.gitconfig, ~/.gitignore_global symlink, ~/gitconfig_helper.py symlink, ~/.gitconfig.local, and the cron job (the line tagged # gitconfig-autoupdate, plus an untagged one from an older install; other cron entries are kept).
git alias opens an interactive, categorized browser: clickable/arrow-key tabs
per category, a search box that filters by alias name or description, and a result
table you move through with up/down. Press Enter (or click a row) to pick an
alias. It needs a terminal and the optional textual package; when piped, in scripts,
or without textual it falls back to a static grouped table. Force the static table
with git alias --plain.
git alias # Browse all aliases (interactive in a terminal)
git alias --plain # Static grouped table (good for piping: git alias --plain | grep pr)In the browser: type to search, up/down to move, Enter/click to select, Ctrl+Left/Right to switch category, Esc to clear the search (or quit), Ctrl+C to quit.
When you open the browser by typing git alias, selecting an alias copies git <alias>
to your clipboard (paste with Cmd/Ctrl-V) — a typed git alias runs as a subprocess and
can't type at your prompt. To have it inserted at the prompt directly, open the browser
with the Ctrl-G keybinding instead.
Insert an alias at your prompt — Ctrl-G
The installer adds a Ctrl-G keybinding to your shell (bash/zsh) and PowerShell profile.
Press Ctrl-G at the prompt to open the browser; the alias you pick is typed onto your
command line, ready to run or edit. A program launched by git alias can't type at your
prompt itself, so this keybinding does the insertion — like fzf's Ctrl-T. Enable it
manually by sourcing the matching widget:
# bash (~/.bashrc) or zsh (~/.zshrc)
source /path/to/gitconfig/scripts/shell/git-alias-widget.bash # or .zsh# PowerShell ($PROFILE)
. "C:\path\to\gitconfig\scripts\shell\git-alias-widget.ps1"Inspect
git s # Short, branch-aware status (status -sb)
git lg # Pretty, decorated commit graph across all branches
git last # Show the most recent commit with its diffstat
git recent # Local branches ordered by most recent commit
git find <string> # Commits that added or removed <string> (log -S)Commit
git amend # Fold staged changes into the last commit, keep its message
git reword # Edit the last commit's message
git undo # Undo the last commit but keep its changes staged
git unstage <path> # Unstage files while keeping working-tree changes
git wip # Park all current work as a WIP commit (skips hooks)Branch & Sync
git nb <name> # Create and switch to a new branch (switch -c)
git pushf # Force-push the current branch safely (--force-with-lease)
git sync # Update the current branch with rebase + autostash
git start <issue#> # Make a conventionally named branch from a GitHub issue's title
git branches # Track all remote branches
git cleanup # Delete local branches whose remote is gone (--force: merged local-only too)
git main # Switch to the default branch: fetch, fast-forward only, branch cleanup
git main --all # Run the above for every git repo in immediate subdirectories (alias: -a)GitHub
git pr # Open the current branch's pull request in the browser
git prs # Show the status of your pull requestsMaintenance
git localconfig # Edit machine-specific git config (~/.gitconfig.local)
git selfupdate # Pull this repo and reinstall ~/.gitconfig from the templateClaude Skills
git skill # Print available subcommands (same as git skill help)
git skill list # Table of installed skills: name, description, last updated
git skill sync # Sync ~/.claude/skills: status -> pull --ff-only -> status
git skill status # Show ~/.claude/skills state: last background sync + unpublished local changes
git skill publish # Publish new/edited skills via a PR (prompts for a message, auto-merges)& ".\scripts\windows version\install.ps1" -Force # Full setup
& ".\scripts\windows version\install.ps1" -Force -NoTask # Skip scheduled task
& ".\scripts\windows version\Initialize-GitConfig.ps1" -Force # Regenerate .gitconfig from template
& ".\scripts\windows version\Initialize-Symlinks.ps1" -Force # Recreate symlinks
& ".\scripts\windows version\Initialize-LocalConfig.ps1" -Force # Regenerate local config.gitconfig.template- Template for generating machine-specific Git configuration.gitignore_global- Global gitignore patterns for editor/OS junk and secrets only (language and build patterns belong in each project's own.gitignore)gitconfig_helper.py- Python utility for managing git aliases, branch cleanup, and main branch operationsscripts/- Platform-specific setup and automation scripts
Symlink creation fails (Windows): Run PowerShell as Administrator.
Python dependency issues:
python -m pip install --upgrade pip
python -m pip install rich textualrich is required; textual is optional and only powers the interactive
git alias browser. Without it, git alias shows the static grouped table.
These are declared in pyproject.toml (rich required; textual
under the optional tui extra); the setup/update scripts read it and install them
for you, so the manual pip install above is only needed as a fallback.
git alias shows a static table instead of the interactive browser: install
textual (pip install textual) and run git alias directly in a terminal —
the interactive UI is skipped when output is piped/redirected or when stdout is
not a TTY. git alias prints a one-line reason to stderr when it skips the
browser, so the cause is visible. If a crashed TUI ever leaves the terminal in a
weird state (the browser looks broken or the keybinding stops responding), run
reset or open a fresh tab to restore it.
Aliases not working: Verify the symlink exists and .gitconfig includes the helper path.
git log --show-signature says "No signature" on a signed commit: Install writes a
~/.ssh/allowed_signers entry for your signing key and points
gpg.ssh.allowedSignersFile at it (in ~/.gitconfig.local) so git can verify SSH
signatures locally. If you signed before this was set up, re-run install (or
git selfupdate) to regenerate it. GitHub verifies signatures independently, so commits
show as Verified there regardless.
Personal configuration repository.