How to fix fatal: bad boolean config value in Git

GitBEGINNERMEDIUMUpdated Dec 6, 2025· 231 views

This error occurs when a Git configuration setting expects a boolean value (true/false) but receives an invalid value instead. Common causes include accidental equals signs, quoted values, or null entries from GUI clients.

Quick fix

Fixes fatal: bad boolean config value

fatal: bad boolean config value '=' for 'core.autocrlf'
  1. Identify the problematic setting and its location
  2. Unset the problematic config value
  3. Set the correct boolean value
  4. Edit the config file directly if needed
git — error
fatal: bad boolean config value '=' for 'core.autocrlf'
fatal: bad boolean config value

What this error means

When Git encounters a configuration option that expects a boolean value but finds something invalid, it displays "fatal: bad boolean config value '<value>' for '<setting>'". Git boolean settings must use specific values: true, yes, on, 1 for true, or false, no, off, 0 for false. This error commonly occurs in three scenarios: 1. **Accidental equals sign in commands**: Running `git config core.autocrlf = false` passes "=" as the value instead of "false" because Git interprets the space before = as ending the value parameter. 2. **GUI clients setting null values**: Some Git GUI tools (like GitKraken) may set config values to "null" rather than removing settings, which Git cannot interpret as a boolean. 3. **Quoted boolean values**: Having values like `"false"` (with literal quotes in the config file) instead of just `false` causes parsing errors. The config setting can be at any level - system (/etc/gitconfig), global (~/.gitconfig), or local (.git/config) - and any of these files may contain the malformed value.

Typical symptoms

  • Git commands fail with 'fatal: bad boolean config value' followed by the problematic value and setting name
  • Error appears when running common commands like git status, git pull, git push, or git commit
  • Issue appears after changing Git settings or installing/updating a Git GUI client
  • Commands work for some repositories but fail for others (indicating local vs global config issue)
  • Error message shows unexpected values like '=', 'null', or quoted strings for boolean settings

Common causes

  1. Using equals sign with spaces in git config command (git config key = value instead of git config key value)
  2. Git GUI client (GitKraken, Sourcetree, etc.) wrote 'null' to a boolean setting
  3. Boolean value has quotes around it in the config file ("false" instead of false)
  4. Typo in the config value (e.g., 'tru' instead of 'true', 'fasle' instead of 'false')
  5. Copy-pasted config from documentation included invisible characters or wrong quotes
  6. Merge conflict in config file left invalid syntax

How to fix "fatal: bad boolean config value"

1Identify the problematic setting and its location

First, find where the invalid config value is defined. The error message tells you which setting is affected.

Read the error message carefully:

bash
fatal: bad boolean config value '=' for 'core.autocrlf'

This tells you:
- The invalid value is '='
- The setting is 'core.autocrlf'

Find where this setting is defined:

bash
# Show the value and its source file
git config --show-origin --get core.autocrlf

# Example output:
# file:/home/user/.gitconfig    =

List all values (in case of duplicates):

bash
git config --show-origin --get-all core.autocrlf

Show the scope (system/global/local):

bash
git config --show-origin --show-scope --get core.autocrlf

# Example output:
# global  file:/home/user/.gitconfig    =

This tells you which file to edit and at what level (system, global, or local).

2Unset the problematic config value

The safest way to fix the issue is to unset the invalid value and then set it correctly.

For global config (~/.gitconfig):

bash
# Unset the value
git config --global --unset core.autocrlf

# Verify it's removed
git config --global --get core.autocrlf
# Should return nothing

For local repository config (.git/config):

bash
# Unset locally
git config --unset core.autocrlf

For system config (requires admin/root):

bash
# On Linux/macOS
sudo git config --system --unset core.autocrlf

# On Windows (run as Administrator)
git config --system --unset core.autocrlf

If there are multiple values:

bash
# Unset all values for this key
git config --global --unset-all core.autocrlf
3Set the correct boolean value

After unsetting, set the value correctly. Git accepts several formats for boolean values.

Valid boolean values:

| True values | False values |
|-------------|--------------|
| true | false |
| yes | no |
| on | off |
| 1 | 0 |

Set the value correctly (no equals sign with spaces!):

bash
# CORRECT - no spaces around the value
git config --global core.autocrlf true

# CORRECT - alternative syntax with equals (no spaces)
git config --global core.autocrlf=true

Common mistakes to avoid:

bash
# WRONG - equals sign becomes the value
git config --global core.autocrlf = true

# WRONG - quotes might be stored literally in some shells
git config --global core.autocrlf "true"

# WRONG - case matters in some contexts
git config --global core.autocrlf TRUE

Verify the setting:

bash
git config --global --get core.autocrlf
# Should output: true
4Edit the config file directly if needed

If git config commands don't work due to the corruption, edit the file directly.

Open the config file in your editor:

bash
# Edit global config
git config --global --edit

# Or open directly
# Linux/macOS
nano ~/.gitconfig
# or
vim ~/.gitconfig

# Windows
notepad %USERPROFILE%\.gitconfig

Find and fix the problematic line:

ini
# WRONG - has equals sign as value
[core]
    autocrlf = =

# WRONG - has null value
[commit]
    gpgsign = null

# WRONG - has quoted value
[http]
    sslverify = "false"

# CORRECT
[core]
    autocrlf = true
[commit]
    gpgsign = true
[http]
    sslverify = true

Common config file locations:

| Level | Linux/macOS | Windows |
|-------|-------------|---------|
| System | /etc/gitconfig | C:\Program Files\Git\etc\gitconfig |
| Global | ~/.gitconfig | C:\Users\<name>\.gitconfig |
| Local | .git/config | .git\config |

5Handle GitKraken or other GUI client null values

GitKraken and some other Git GUI clients are known to write "null" to config settings instead of removing them.

Common affected settings:

bash
# Check for null values in common settings
git config --global --get commit.gpgsign
git config --global --get tag.forcesignannotated
git config --global --get user.signingkey

Fix null values:

bash
# If you want the feature disabled, unset it
git config --global --unset commit.gpgsign

# If you want the feature enabled, set it properly
git config --global commit.gpgsign true

Prevent future issues with GitKraken:

If you're using GitKraken and experiencing repeated null values:

1. Check if there's an update for GitKraken that fixes this issue
2. Configure settings via command line instead of the GUI
3. After making changes in GitKraken, verify config with:

bash
git config --global --list | grep -i null
6Fix all boolean config issues at once

If you have multiple invalid boolean values, you can find and fix them all.

List all config values to inspect:

bash
# Show all configs with their origins
git config --list --show-origin --show-scope

Search for suspicious values:

bash
# Look for null values
git config --list | grep -i null

# Look for equals signs as values
git config --list | grep "= ="

# Look for quoted values (in config file)
grep -E '= ["']' ~/.gitconfig

Reset problematic sections entirely:

bash
# Remove entire section and re-add only what you need
git config --global --remove-section core
git config --global core.autocrlf true
git config --global core.editor "code --wait"
# Add other core settings as needed

Note: Be careful with --remove-section as it removes ALL settings in that section.

7Verify the fix

After making changes, verify Git is working correctly.

Test basic commands:

bash
# These should all work without errors
git status
git config --list
git log --oneline -5

Verify the specific setting:

bash
# Check the value is correct
git config --show-origin --show-scope core.autocrlf

# Should show something like:
# global  file:/home/user/.gitconfig    true

Test in your repository:

bash
cd your-repo
git status
git fetch

If commands work without the "bad boolean config value" error, the fix was successful.

8Prevent this error in the future

Follow these practices to avoid boolean config errors:

Always use correct syntax:

bash
# CORRECT - value directly after the key
git config --global core.autocrlf true

# CORRECT - equals without spaces
git config --global core.autocrlf=false

# WRONG - spaces around equals
git config --global core.autocrlf = true

Use tab completion: Most shells complete git config keys, reducing typos.

Check after GUI changes: After using Git GUIs, verify config:

bash
git config --list --show-origin | head -20

Back up your config: Keep a backup of your working ~/.gitconfig:

bash
cp ~/.gitconfig ~/.gitconfig.backup

Use git config --type for validation:

Git 2.18+ supports type validation:

bash
# This validates the value is a valid boolean
git config --global --type=bool core.autocrlf true

Advanced notes

### Understanding Git Config Levels

Git reads configuration from multiple files in order of precedence (later overrides earlier):

1. System (/etc/gitconfig): Applies to all users on the system
2. Global (~/.gitconfig): Applies to all repositories for the current user
3. Local (.git/config): Applies only to the specific repository
4. Worktree (.git/config.worktree): Git 2.20+, per-worktree settings

A bad value at any level can cause the error. Use --show-origin to identify which file.

### Boolean Normalization

Since Git 2.39, Git explicitly describes all boolean values as "true" or "false" in output, even if you set them as "yes", "on", or "1". Internally, Git accepts all these synonyms:

- True: true, yes, on, 1
- False: false, no, off, 0 (empty string also means false for some settings)

### Common Boolean Settings

These settings expect boolean values and commonly trigger this error:

| Setting | Purpose |
|---------|---------|
| core.autocrlf | Line ending conversion |
| core.filemode | Track file permission changes |
| core.ignorecase | Case sensitivity |
| core.longpaths | Windows long path support |
| commit.gpgsign | Sign commits with GPG |
| push.autosetupremote | Auto track remote branches |
| http.sslverify | Verify SSL certificates |
| pull.rebase | Rebase on pull |

### CI/CD Considerations

In CI/CD pipelines, this error might appear from:

1. Environment variable conflicts: GIT_TERMINAL_PROMPT=0 is valid, but GIT_TERMINAL_PROMPT="0 for" is not
2. Docker image configs: Base images may have corrupted gitconfig
3. Shared runners: Previous jobs may have modified global config

Fix in CI:

yaml
# GitLab CI example
before_script:
  - git config --global --unset-all core.autocrlf || true
  - git config --global core.autocrlf false

### Windows-Specific Issues

On Windows, Git config files might have:

- BOM (Byte Order Mark): Can corrupt the file
- Wrong line endings: Use LF, not CRLF in gitconfig
- Hidden characters: Copy-paste from web might include invisible characters

To fix BOM issues on Windows:

powershell
# PowerShell - resave without BOM
$content = Get-Content ~/.gitconfig -Raw
[System.IO.File]::WriteAllLines("$env:USERPROFILE\.gitconfig", $content)

Frequently asked questions

What does "fatal: bad boolean config value" mean?
When Git encounters a configuration option that expects a boolean value but finds something invalid, it displays "fatal: bad boolean config value '<value>' for '<setting>'". Git boolean settings must use specific values: true, yes, on, 1 for true, or false, no, off, 0 for false. This error commonly occurs in three scenarios: 1.
How do I fix "fatal: bad boolean config value"?
This error occurs when a Git configuration setting expects a boolean value (true/false) but receives an invalid value instead. Common causes include accidental equals signs, quoted values, or null entries from GUI clients.
What causes "fatal: bad boolean config value"?
Using equals sign with spaces in git config command (git config key = value instead of git config key value) Git GUI client (GitKraken, Sourcetree, etc.) wrote 'null' to a boolean setting Boolean value has quotes around it in the config file ("false" instead of false)
Is the "fatal: bad boolean config value" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading