23

I would want to know what is this Git error at the start of Git bash ?

chmod: changing permissions of '/dev/mqueue': Permission denied
ln: failed to create symbolic link '/etc/mtab': Permission denied
'C:\WINDOWS\system32\drivers\etc\hosts' -> '/etc/hosts'
/usr/bin/cp: cannot create regular file '/etc/hosts': Permission denied
'C:\WINDOWS\system32\drivers\etc\protocol' -> '/etc/protocols'
/usr/bin/cp: cannot create regular file '/etc/protocols': Permission denied
'C:\WINDOWS\system32\drivers\etc\services' -> '/etc/services'
/usr/bin/cp: cannot create regular file '/etc/services': Permission denied
'C:\WINDOWS\system32\drivers\etc\networks' -> '/etc/networks'
/usr/bin/cp: cannot create regular file '/etc/networks': Permission denied
rm: cannot remove '/etc/post-install/01-devices.post': Permission denied
rm: cannot remove '/etc/post-install/03-mtab.post': Permission denied
rm: cannot remove '/etc/post-install/06-windows-files.post': Permission denied
rm: cannot remove '/etc/post-install/99-post-install-cleanup.post': Permission denied
3
  • 1
    What has this got to do with CMD or SYSTEM32.
    – user12431753
    Commented Feb 21, 2020 at 6:33
  • This error is showing me on Gitbash Commented Feb 21, 2020 at 6:36
  • Do the errors occur if you run Gitbash as Administrator?
    – ElpieKay
    Commented Feb 21, 2020 at 6:44

4 Answers 4

47

See https://github.com/git-for-windows/git/issues/1449. This happens when the post-install scripts fail to run for some reason.

Running Git Bash as administrator once triggers execution of those scripts and fixes the problem.

7

Yes, this happened to me after downloading Git for Windows 2.29.0, post-install scripts failed, and running it as admin once allows the chmod command to work and permanently fixes the problem! I would like to add: this may happen to every update that Git Bash has; you just have to occasionally run Git as administrator (right after finishing update) for the scripts to run!

4

Try to log in as admin in your bash to see if that solves your problem!

1
  • Why must Git Bash be run with elevated privileges now? It didn't require this in the past Commented Jun 4, 2020 at 14:20
0

i installed git to VM linux, then i switched to my windows10 then i run the git bash, I have the same problem, then i run git bash as admin, and it fixed!

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.