Languages
[Edit]
EN

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

12 points
Created by:
Root-ssh
6407

1. Problem description:

When I run git config to remove credentials I get error:

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

Screenshot from Git Bash with this error:

Screenshot showing error - git config --system --unset credential.helper error: could not lock config file C:/Program Files/Git/mingw64/etc/gitconfig:  Permission denied - solution: https://dirask.com/q/9pYBkj

I use git bash on windows 10
How to solve it?

2. Solution:

  1. Open Git Bash as administrator
  2. Execute once again: $ git config --system --unset credential.helper
  3. And git config works without any errors

Screenshot from Git Bash when we run this command as administrator:

Screenshot showing FIX for error - git config --system --unset credential.helper error: could not lock config file C:/Program Files/Git/mingw64/etc/gitconfig:  Permission denied - solution: https://dirask.com/q/9pYBkj

How to open Git Bash as administrator?

  1. Click on Windows search
  2. Type Git Bash
  3. Click on it with second mouse button (right one)
  4. Click 'Run as administrator'
  5. If Popup dialog appears - click Yes
  6. Now we execute Git Bash commands with administrator rights

Link to post - How to open Git Bash as administrator?

3. Video with solution

References

  1. Git config - docs
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.