Repository navigation
gitmeright is now a real CLI. setup.sh is gone — replaced by bin/gitmeright with eight subcommands, unlimited profiles, and two things nothing else has: whoami tells you which identity a repo resolves to and why, and doctor finds the silent misconfigurations git will never warn you about.
curl -fsSL https://raw.githubusercontent.com/s403o/gitmeright/main/install.sh | bash
gitmeright initVerified on Ubuntu and macOS: 69 tests, ShellCheck clean, every assertion made through git config on a real fixture repo.
A full rewrite. setup.sh is gone; gitmeright is now a real CLI.
⚠️ Breaking
setup.shhas been removed. Install v2 and rungitmeright init. Your old
~/.gitconfig-*files are no longer used and can be deleted oncegitmeright doctor
is green. See Upgrading in the README.- Config now lives under
~/.config/gitmeright/.~/.gitconfiggets one appended
[include]line instead of being replaced. - SSH keys are named
id_ed25519_<profile>(they were always ed25519; the old
id_rsa_*names were simply wrong).
Fixed
~/.gitconfigis no longer destroyed. The old script rancp .gitconfig ~/.gitconfigwith no backup, no confirmation and no uninstall, wiping signing keys,
credential helpers, proxy settings and every alias. v2 backs up to
~/.gitconfig.gitmeright.bak.<timestamp>and only appends.- Identities now actually get written on macOS. Nine of thirteen
sed -icalls used
the GNU-only form, which fails on BSD/macOS — so the step that substituted your name and
email silently did nothing, leaving configs readingemail = you@personal.comwhile the
script printed✅ Setup complete!. Allsedis gone; config is generated via
git config -f. - Rules now match the host and org you actually use. The old script substituted your
profile label into a hardcodedbitbucket.org/gitlab.compattern, so unless your
workspace happened to be named after your label, the rule never fired — silently, since
git reports no error for anincludeIfthat never matches. IdentitiesOnly=yesis now set on every profile. Without itssh -imerely adds
a key to the candidate list, so a pre-existing default key could authenticate you as the
wrong account whilegit config user.emailshowed the right address.- No more
evalon prompt input (it was arbitrary code execution). Values are stored
withprintf -v. - Strict mode.
set -euo pipefailplus anERRtrap replace zero error checks against
twenty filesystem-mutating commands. The success message is now earned: each profile is
resolved against a throwaway repo and read back throughgit config. - Names containing
&,/,\or"round-trip correctly. - Labels are validated before becoming filenames.
~/.sshis forced to700and keys to600; a half-generated key pair is reported
instead of being skipped with a green check.- The orphaned
ssh-agent(started in a subshell whose environment died with the script)
is gone.
Added
gitmeright whoami— which identity this repo resolves to, and why, including a
per-rule reason when nothing matches.gitmeright doctor— ten health checks git will never warn you about.--onlineasks
each host which account actually answered.gitmeright add/remove/list— unlimited profiles, no fixed ceiling of three.gitmeright guard— optional pre-commit hook blocking commits in repos that match no
profile. Refuses to overwrite an existing hook.gitmeright uninstall— restores~/.gitconfigbyte-for-byte.gitmeright tweaks— the opinionated defaults (pull.rebaseetc.) are now opt-in
instead of riding along with identity routing.- Matching by HTTPS remote and by directory (
gitdir:), not just SSH remotes.
Directory rules work before a remote exists and back to git 2.13. - Git version gate with a clear message and a
gitdir:fallback below 2.36. - Flags:
--dry-run(writes nothing at all),--yes,--non-interactive,--quiet,
--help,--version. - One-line installer, MIT
LICENSE(the badge previously linked to nothing), and
CONTRIBUTING.md.
Changed — testing
- The old suite had 18 assertions, none behavioural: it grepped generated files, and
one assertion passed on exactly the text that constituted a critical bug. A 28-line
email-validation step could not fail at all — a validator accepting every input still
exited 0 and printed ✅. - Replaced with 69 bats tests, each against a throwaway
$HOME, each asserting through
git configon a fixture repo. Validated by mutation testing: reintroducing each
original bug turns the suite red. - CI matrix went from Ubuntu×2 to Ubuntu×2 + macOS×2 — the platform the README claimed
and CI never tested. ShellCheck is now a required gate.