PricingSign inDownload

Blog / git

Find and undo a git setting your coding agent changed

An agent ran git config and now hooks don't run, pulls rebase, or commits go unsigned. List every setting with where it lives, then undo the agent's ones.

On this page
  1. List everything, with its source
  2. The settings agents change most
  3. Undo a setting
  4. When the setting isn't in any file
  5. Find out when it changed
  6. Stop it happening again
  7. Where Joxo fits
  8. Frequently asked questions
  9. How do I see which git config file a setting comes from?
  10. How do I remove a git config setting?
  11. Why are my git hooks not running?
  12. Why does git config say "command line" for a setting I never typed?
  13. Does git keep a history of config changes?
  14. Try it with your team

Agents change git settings to get past whatever is in their way. A hook fails, so the agent sets core.hooksPath to /dev/null. A pull complains about divergent branches, so it sets pull.rebase globally. Signing asks for a passphrase, so commit.gpgsign goes to false. Each change fixes the agent's problem and quietly changes how git behaves for you, sometimes in every repository on your machine. Here is how to see every setting, where each one comes from, and how to put things back. We ran every command here with git 2.43 on test repositories.

List everything, with its source#

bash
git config --list --show-scope --show-origin
system  file:/etc/gitconfig            filter.lfs.required=true
global  file:/home/dev/.gitconfig      user.email=dev@example.com
global  file:/home/dev/.gitconfig      pull.rebase=true
global  file:/home/dev/.gitconfig      alias.save=!git add -A && git commit -m wip
local   file:.git/config               core.hookspath=/dev/null
local   file:.git/config               commit.gpgsign=false

The scope column is what matters:

  • system is for every user on the machine, usually /etc/gitconfig. Agents rarely touch it, since it needs root.
  • global is your user's settings, ~/.gitconfig or ~/.config/git/config. A change here follows you into every repository.
  • local is this repository's .git/config. It only affects this clone, and it isn't committed, so teammates don't get it.
  • worktree is a single worktree's settings, used only if extensions.worktreeConfig is on.
  • command means it came from git -c or from environment variables, not from any file.

For one setting, ask directly:

bash
git config --show-scope --show-origin core.hooksPath
local   file:.git/config        /dev/null

Git reads the scopes in order, and the last one wins. A local value beats a global one, and a command-line value beats both.

The settings agents change most#

Look for these first. Each one has a reason an agent reaches for it, and a cost to you:

  • core.hooksPath. Set to /dev/null or an empty folder, it turns off every hook. In our test, a pre-commit hook that failed every commit stopped running the moment this was set, and the commit went through. Your lint, format and secret checks go with it. See stop a coding agent skipping git hooks.
  • commit.gpgsign and tag.gpgsign. Set to false, commits stop being signed, and a branch that requires signed commits rejects them later.
  • pull.rebase and pull.ff. These change what git pull does in every repository when set globally. Rebasing on pull rewrites your local commits, which is a surprise if you're used to merges.
  • user.name and user.email. An agent that sets these globally makes your own commits show its name. See fix the author on an agent's commits.
  • core.editor. Agents set it to true or cat to stop git opening an editor. Your next git commit without -m then aborts with an empty message instead of opening your editor.
  • safe.directory. A '*' here turns off a security check for every repository. See git says dubious ownership.
  • alias.*. New aliases are mostly harmless, but one that shadows a habit of yours, or runs git add -A, is worth removing.
  • core.autocrlf and core.filemode. These change how files are compared and can make every line look changed; see an agent changed every line.

Undo a setting#

Remove a setting from the scope it's in. Use the scope --show-scope printed:

bash
git config --unset core.hooksPath
git config --unset commit.gpgsign
git config --global --unset pull.rebase
git config --global --unset alias.save

Without --global, --unset acts on the local scope. If a key has several values, as safe.directory often does, use --unset-all, then add back the ones you want.

Check afterwards:

bash
git config --show-scope --show-origin --get-regexp 'hookspath|gpgsign|pull\.'

No output means none of those is set anywhere, and git is back to its defaults for them.

If you'd rather see the whole file, git config --global --edit opens it in your editor. That's often faster when an agent added a dozen lines.

When the setting isn't in any file#

If --show-scope says command, the value comes from the environment the agent ran in. Git reads GIT_CONFIG_PARAMETERS, and the pairs GIT_CONFIG_COUNT, GIT_CONFIG_KEY_0 and GIT_CONFIG_VALUE_0. We set core.hooksPath this way and git reported:

command command line:   /tmp

You won't find it in any config file. Look in the agent's settings, a wrapper script, a container's environment, or a .envrc file. Your own terminal doesn't have it, which is why the agent sees different behavior from you.

Some agent tools also set their own values this way on purpose, for example to turn off interactive credential prompts. Those only apply to the agent's commands and are usually fine; read what each one does before removing it.

Find out when it changed#

Git doesn't keep a history of config changes. Two things help:

  • The agent's own log. Search its session or transcript for git config. That gives you the exact commands it ran.
  • A backup next time. Keep a copy of your global settings in your dotfiles repository, or at least run cp ~/.gitconfig ~/.gitconfig.bak before a long unattended run. Then diff ~/.gitconfig.bak ~/.gitconfig shows what changed.

Stop it happening again#

  • Write the rule down. In CLAUDE.md or AGENTS.md: never run git config --global; never change core.hooksPath, signing or safe.directory; if a hook fails, fix the cause or stop and ask.
  • Make it ask. In Claude Code, add Bash(git config:*) to the ask list in .claude/settings.json, so every config change needs your answer. A deny entry blocks it outright.
  • Keep agents out of your global config. An agent running as its own user, or in a container, has its own ~/.gitconfig. Whatever it changes stays there.
  • Put the important ones where agents can't reach. A setting in /etc/gitconfig needs root to change. Hooks enforced on the server, or by a required check on pull requests, can't be turned off from a laptop at all.

Where Joxo fits#

On a team, one person's agent turning off hooks in a shared setup script affects everyone's commits. In Joxo, your agents share one project with notes every agent reads before it starts, so "never touch git config" is a rule written once for every teammate's agent. Setup is one line pasted into your agent.

Frequently asked questions#

How do I see which git config file a setting comes from?#

Run git config --list --show-scope --show-origin. Each line shows the scope (system, global, local, worktree or command) and the file the value was read from.

How do I remove a git config setting?#

Run git config --unset with the key, adding --global if --show-scope says the setting is global. For a key with several values, use --unset-all.

Why are my git hooks not running?#

Check git config --show-origin core.hooksPath. If it's set to /dev/null or an empty folder, git skips every hook. Unset it and the hooks in .git/hooks run again.

Why does git config say "command line" for a setting I never typed?#

It came from environment variables such as GIT_CONFIG_PARAMETERS or GIT_CONFIG_COUNT. Look in the agent's settings, a wrapper script or the container it runs in.

Does git keep a history of config changes?#

No. Search the agent's session log for git config commands, and keep a backup of ~/.gitconfig, ideally in a dotfiles repository, so you can compare later.