I am learning Git Hub. So I am a newbie. Trying to remove git related files in project directory. I used this line:
rd .git /S/Q
However it gives me this error when I use VS Code:
Remove-Item : A positional parameter cannot be found that accepts argument '/q'. At line:1 char:1 + rd /s /q .git + ~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Remove-Item], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
and when I use CMD - command promt it gives me this error:
.git\refs\remotes - The directory is not empty.
What is going on. This is where I get my information about this: From stackoverflow From YouTube
I am using Windows 10 btw.
EDIT: I tried:
rd /S /Q .git
and I get error:
Remove-Item : A positional parameter cannot be found that accepts argument '/Q'. At line:1 char:1 + rd /S /Q .git + ~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Remove-Item], ParameterBindingException
Tried:
rd /S/Q .git
Error:
Remove-Item : A positional parameter cannot be found that accepts argument '.git'. At line:1 char:1 + rd /S/Q .git + ~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Remove-Item], ParameterBindingException
However I tried in command promt:
rd /S /Q .git
And I get :
.git\refs\remotes - The directory is not empty.
I try it second time right after that and it works... So what am I missing here?
EDIT 2:
All of these comands work in command promt but only if I type them for the second time. Including the command - rd .git /S/Q. The first time I get :
.git\refs\remotes - The directory is not empty.
and if I type it for the second time it works. In VS Code it is not working no matter how many times I type them.