vscode
vscode copied to clipboard
Deletion of directory '...' failed. Should I try again? (y/n)
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version:
1.86.2
903b1e9d8990623e3d7da1df3d33db3e42d80eda
x64
- OS Version:
Edition Windows 10 Enterprise
Version 22H2
OS build 19045.3930
Experience Windows Feature Experience Pack 1000.19053.1000.0
Steps to Reproduce:
- Configure VS Code as git's editor
git config --global core.editor = 'code --wait --reuse-window --disable-extensions' - start an interactive rebase
git rebase HEAD~2 -i - Delete all text in the rebase file
- Save
- Close visual studio
See error: Deletion of directory '...' failed. Should I try again? (y/n)
I'm also using windows terminal with git-bash and this entirely breaks the terminal forcing me to close the tab.
There does appear to be a race condition as leaving visual studio open for a longer period of time does not exhibit the error (i.e. it's inconsistent).
You might have a subdirectory in the directory you are trying to delete.
I get the same symptoms, but I am using Notepad++ as my editor. i.e. I will do a rebase, and at the end I get Deletion of directory '.git/rebase-merge' failed. Should I try again? (y/n). Sometimes it's that git-internal path, other times it can't delete a directory which was removed as part of the rebase. In other words, this might not be a vscode bug. I never saw this error in years of using git, until recently when I also started using Windows Terminal for the first time. Perhaps that's related.
I am using Windows Terminal as well.
Run PowerShell with administration permission.
@HughWarrington, is your repo in OneDrive?
Run PowerShell with administration permission.
The original reporter was not using PowerShell and nor was I.
@HughWarrington, is your repo in OneDrive?
No. But it was in Google Drive.
I am encountering the same problem.
I am also on Windows 10 Enterprise, version 22H2 and the issue persists with (as of writing) the latest git version (version 2.47.1 64-bit for windows). I am not admin of my PC.
I first got the issue when I started to git rebase in git bash inside VS Code, but after investigation the problem appeared in different configurations (with git bash and the windows terminal inside and outside of VS Code).
It seems like all kind of folders can't be deleted by git (folders inside the .git folder and the repo's).
I had the same problem. If your files are in One Drive you will have problems with Git. My situation is even worse. I have to use portable vscode and portable git. If it is possible try to move stuff somewhere outside One Drive and test it. Works for me.
ran into this just now as well, git repository is inside OneDrive. could set the answers to default to no, but wish it worked out of the box
I also have this problem. For me, it's when I try to run git gc (and I would expect other git commands that try to clean up folders). My repo is also in OneDrive. Since I'm not currently using VSCode in this repo (but rather just Git for Windows), I would expect this is a Git problem, and not a VSCode problem.
Yeah since I originally commented, I have found I also get the problem using the git-bash that is bundled with GitHub Desktop (and with my repo still stored in Google Drive). Interestingly, this problem occurs 100% of the time, it's not intermittent. But this strongly points to it not being a vscode issue. I would recommend to close this ticket as it needs to be filed upstream.
I was facing issue while pulling changes from remote branch, git somehow cannot delete the last folder and getting stuck in yes or no permission to delete the folder. Manually deleting the folders in you'r local repo will solve the issue, infact git itself will give you the folder name which it cannot delete just remove that one and terminate current terminal next pull again
Given the reports with other programs I'm closing this as it's not likely to be a VSCode specific issue.
A recent fix was made to git which may also resolve this: https://github.com/git-for-windows/git/issues/4776
@Forge36 I can't see how that other ticket is relevant, but you did the right thing to close this ticket in any case.