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?
- 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