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
68570

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
Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join