I'm trying to clone a git repo. I'm using cygwin on a windows 7 OS. Somehow, it fails, but create a folder. When I try to delete it, got this message:
rmdir: fallo al borrar «myRepoName/»: Device or resource busy
I can't delete it even using the windows explorer.
¿What does it means this message, and how can I delete these folders?
Just run the rm command with the -f and -r switch to recursively remove the . git folder and all of the files and folders it contains. This Git repo remove command also allows you to delete the Git repo while allowing all of the other files and folder to remain untouched.
Delete the file/folder using Command Prompt Go to Search and type cmd. Click on Run as administrator to open Command Prompt with full permissions. In the Command Prompt, enter del, followed by the path of the folder or file you want to delete, and press Enter (for example del c:usersJohnDoeDesktoptext. txt).
Use rm -r switch with the git command to remove directory recursively. After removing the directory you need to commit changes to the local git repository. Then push the changes to remove the directory from the remote git repository.
Yes, you can simply delete the . git folder if you no longer want to use Git version control on those files.
Make sure that no shells, Windows explorer windows or applications are open to anything in the git subtree and try again. Next, close all your apps and try again. If that doesn't work, reboot and try again. Windows is overly protective of open files and directories, and some apps don't close them properly.
I know this is a bit old but hopefully this helps someone else who experiences this issue.
I found that, in Windows 10 at least, using the task manager to stop all git processes is enough to free up the files so they can be removed. Then simply restart git and you are good to go. No reboot required.
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