# Git: git: 'credential-osxkeychain' is not a git command. See 'git --help'

**Code:** `git: 'credential-osxkeychain' is not a git command` · **Category:** macOS · **Seen on:** macOS, Git

Git is configured to use the macOS keychain helper, but the helper binary isn't found by the Git you're running.

## Meaning

Apple's Git bundles `git-credential-osxkeychain`. A Homebrew Git or Xcode switch can lose it. Fix with `git config --global credential.helper osxkeychain` after ensuring `/usr/bin/git` or installing the helper: `brew install git` includes it in `libexec/git-core`. Or use `git-credential-manager`.

## Common causes

- Homebrew/alternate Git without the helper in PATH
- Xcode/CLT reinstall removed it
- credential.helper set but binary not found
- Unusual PATH ordering
- Git installed via another package manager

## Quick fix

1. Use Apple Git: `/usr/bin/git --version`
2. Reinstall: `brew reinstall git`
3. Set helper: `git config --global credential.helper osxkeychain`

## Detailed fix by platform

### macOS

1. `git config --show-origin --get-all credential.helper && ls $(git --exec-path) | grep osxkeychain`

## How to diagnose

1. **Git** — Which binary?
2. **Helper** — Exists in exec-path?
3. **Config** — credential.helper?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/macos/git-credential-osxkeychain-not-a-git-command)
