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
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:
I use git bash on windows 10
How to solve it?
2. Solution:
- Open Git Bash as administrator
- Execute once again:
$ git config --system --unset credential.helper
- And git config works without any errors
Screenshot from Git Bash when we run this command as administrator:
How to open Git Bash as administrator?
- Click on Windows search
- Type Git Bash
- Click on it with second mouse button (right one)
- Click 'Run as administrator'
- If Popup dialog appears - click Yes
- Now we execute Git Bash commands with administrator rights
Link to post - How to open Git Bash as administrator?