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
Solution to fix the bash: ./program_name: permission denied error. chmod u+x program_name– In this line, the chmod command will change the access mode to execute, denoted by x. only the file's owner will have the permission to execute the file.
Right-click the file or folder, and then click Properties. Click the Security tab. Under Group or user names, click your name to see the permissions that you have. Click Edit, click your name, select the check boxes for the permissions that you must have, and then click OK.
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With