I am aware that there are similar issues about git relating to the \'unable to unlink\' warning, but I have not been able to use them.
The main difference is that th
I think it's about your file permission:
sudo chmod 777 -R <your-git-folder>
I had the same issue , I tried few alternatives as others suggested.
But finally giving correct permission to .git folder solve the issues.
sudo chown -R "${USER:-$(id -un)}" .git
This can also occur when:
You ran a process inside a Docker container, and:
Some files were generated by that process, and:
The destination of the files is mounted as a volume on the Docker host, and:
You are running git
on the Docker host.
If this is the case, stage the files you wish to commit and run:
git diff --name-only --cached | xargs ls -l
Files which meet the above criteria will be prefixed with:
-rw-r--r-- 1 root root ...
They are owned by root
and not writable, which is not good.
To fix that run:
git diff --name-only --cached | xargs -i sh -c 'sudo chown $USER:$USER {}; chmod +w {}'
A cleaner solution would probably be to use the --user
option, see this for Docker and this for Docker compose.
You can change the write permissions to get it done.
sudo chmod -R ug+w .
This command will give 'w'
permissions to all the folders in the current directory.
Make sure that any associated processes or threads are not running and perform end task or force quit as necessary.
Make sure you change the ownership permission.
I was having the issue with a default-settings.php file in drupal 7. In this case I wasn't able to delete it or revert it just like @rtconner said. I didn't have an application or anything using this file, and it ended up being a permissions error.
I added chmod 777 *
to the folder and then I was able to revert it no problem.