Access denied for mv command in Git

402 views Asked by At

I am working on a project and I have initialized a Git repository in child folder. But I want to move it to the parent folder, so I ran this command:

mv .git ../

But I am getting the below error:

mv : Access to the path 'C:\Users\Ashish 
Vispute\OneDrive\Documents\a Real Estate Project\client\.git' is     
denied.
At line:1 char:1
+ mv .git ../
+ ~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\Ashish...ect\cl  
   ient\.git:DirectoryInfo) [Move-Item], IOException
    + FullyQualifiedErrorId : MoveDirectoryItemIOError,Microsoft.Po  
   werShell.Commands.MoveItemCommand

What should I do to resolve it, and which command should I run instead?

1

There are 1 answers

2
Artemij On

Try to stop all processes associated with the folder and files (including code editors) and try again.