'Git folder rename keep failing - permission denied

I am getting this error message from GIT:

rename folder from X to Y failed, should I try again?

What I tried so far:
- Tortoise git
- Git UI
- Git UI with administrator permissions.
- Restart PC
- Git Bash with administrator permissions.

Still the same thing - fatal: renaming folder failed: Permission denied.

UPDATE 3

I changed all file permissions to Everyone

icacls "c:\projects\TRUNK\PRINT_FILES11\" /remove:d Everyone /grant:r Everyone:(OI)(CI)F /T

this is the result of the command:

....
processed file: c:\projects\TRUNK\PRINT_FILES11\maven-compiler-    plugin\compile\default-compile\inputFiles.lst
processed file: c:\projects\TRUNK\PRINT_FILES11\maven-compiler-    plugin\testCompile\default-testCompile
processed file: c:\projects\TRUNK\PRINT_FILES11\maven-compiler-plugin\testCompile\default-testCompile\inputFiles.lst
Successfully processed 77226 files; Failed processing 0 files
C:\WINDOWS\system32>

still getting same thing.

my Tortoise git version is

TortoiseGit 2.8.0.0 (C:\Program Files\TortoiseGit\bin)  
git version 2.18.0.windows.1 (  
    C:\Program Files\Git\bin;   
    C:\Program Files\Git\mingw64\;   
    C:\Program Files\Git\mingw64\etc\gitconfig;   
    C:\ProgramData\Git\config)  

enter image description here enter image description here enter image description here enter image description here

git


Solution 1:[1]

Try to make sure there's nothing going on in the folder you want to rename that would typically keep you from being able to rename the folder via GUI (e.g., having a file open in another program).

I had this problem just now and fixed it after reading this answer on unix.stackexchange.com.

In my case, I happened to have the working directory open in a File Explorer window (I'm on Windows 10 Home 64-bit).

Solution 2:[2]

To solve the issue in a simple way, you can do the following two steps below using git bash:

  1. Rename "PRINT_FILES11" to "tmp"
  2. Rename "tmp" to "Prnt_f"

Here is the command how to do this(worked for windows):

git mv PRINT_FILES11 tmp
git mv tmp Prnt_f

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 michen00
Solution 2 Karthik