Git - git config - error: could not lock config file - Permission denied

3 points
Created by:


I am on windows 10 and got this error:

$ git config --system --unset credential.helper
error: could not lock config file 
C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied

How to solve it?


Quick fix:
Under windows open git bash as administrator

Step by step:
1. Open Windows search
2. Type: Git Bash
3. Click second mouse button and select: Run as administrator
4. Go to your project directory:

cd "C:\path\to\our\project\name"

5. Execute command:

git config --system --unset credential.helper

On linux run this command with sudo command:

sudo git config --system --unset credential.helper
Hey 👋
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.