Skip to content

Fix: Fatal: Could not set core.folemode to false

  • by
  • 3 min read

Git is a great tool to manage multiple versions of a single application and coding collaboratively. That said, it’s not exactly an easy thing to pick up for complete beginners, especially when you’re trying to deal with the CLI-based Git tool. 

In this article, we’re taking a look at the “Fatal: could not set core.folemode to false” issue in Git, its causes and what you can do to solve the problem.

Also read: Git Error: Failed to push some refs to: 4 Fixes


What causes the issue?

The issue can actually be caused by a number of things. Some of the most common reasons include:

  • The command needs administrator privileges to run.
  • Your computer needs a restart.
  • Overly aggressive third-party antivirus.

How to fix this?

Here are four fixes you can try out.

Restart your PC

This should be especially helpful if you’re on Windows. Rebooting your PC can fix all sorts of seemingly random issues with your programs and scripts as it often refreshes the entire operating system meaning corrupt caches and system memory are cleared. 


Run the command with administrative privileges

As mentioned before, not running the command with administrative privileges can also cause this issue. If you’re on Linux or macOS, try adding sudo before the command or if you’re on Windows, running the command in an Administrator Command Prompt or PowerShell windows should do the trick. 

This is an image of terminal1
Running the command with admin privileges might just do the trick.

Temporarily disable your antivirus 

This might sound unrelated, but sometimes an overly-aggressive antivirus program can stop Git from functioning properly because of the process Git uses to update a configuration file or entity. 

The best way to get around this is to temporarily disable your antivirus software while you’re trying to merge to pull from a Git repository. If the command works fine, chances are your Antivirus is at fault here and you might need to add an exception for Git or take a look at the logs to figure out the exact cause and address the issue. 


Try mounting the active drive

If you’re trying to use Git on Windows Subsystem for Linux (WSL), you might need to manually mount the active drive, the one hosting your Git repository, to ensure that the command goes through. 

Simply run the following commands

sudo umount /mnt/c
sudo mount -t drvfs [Drive Letter]: /mnt/c -o metadata

Make sure to get the right drive letter when entering the command above and you should be good to go. 

Also read: How to create a Git repository? How to connect it to GitHub?

Yadullah Abidi

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: yadullahabidi@pm.me.

  • >