Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't delete folder after failed git clone

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?

like image 300
graham o'donnel Avatar asked Jul 16 '15 10:07

graham o'donnel


People also ask

How do I force delete a .Git folder?

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.

How do I fix a folder that Cannot be deleted?

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).

How do you delete a remote repository folder?

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.

Can I just delete .Git folder?

Yes, you can simply delete the . git folder if you no longer want to use Git version control on those files.


2 Answers

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.

like image 118
rholmes Avatar answered Sep 29 '22 09:09

rholmes


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.

like image 25
Kraig Lutz Avatar answered Sep 29 '22 11:09

Kraig Lutz