Whenever I switch between my branch (Li) to the master branch I get the following message:
Deletion of directory 'sys/console/api' failed. Should I try again? (y/n)
Anyone knows how do I get rid of this message? I think that in the past I tried to delete this directory by mistake and now I'm stuck with this error message.
git checkout does not affect untracked files. Git only manages tracked files, and it works fairly hard to avoid letting you lose data (which is critical).
Git Checkout File Checking out a file is similar to using git reset with a file path, except it updates the working directory instead of the stage. Unlike the commit-level version of this command, this does not move the HEAD reference, which means that you won't switch branches.
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 a Directory ( rm -r ) To delete (i.e. remove) a directory and all the sub-directories and files that it contains, navigate to its parent directory, and then use the command rm -r followed by the name of the directory you want to delete (e.g. rm -r directory-name ).
This error message comes from this patch (in compat/mingw.c
), and this one (also in compat/mingw.c).
It usually means your directory is "busy", or isn't empty (but contains only private files, ie non-versioned files).
So make sure that, when checking out a branch, you don't have a running process making your specific directory "busy".
Ted M Young helpfully comments:
Another definition of "busy" is that it's your current directory!
It seems safest to do acd
to the root directory and then change directories to avoid this error.
I just had to quit out of VS Code to get the error to go away
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