How do I get VS Code to stage+commit a file deletion?

40 Views Asked by At

Disclaimers: new to SO, new to Git(Hub)

I'm getting the following error when I try to stage a commit: git add -A -- /home/path/to/some/file.csv fatal: Could not switch to '/home/path/to/some/': No such file or directory

I'm working on a remote machine using Git+GitHub, but mostly in VSCode and the bash shell. I was trying to move a folder with a few files into a new location, and after successfully doing mv root/path/to/some/dir/ root/path/to/new/dir, I went to the VSCode Source Control to stage+commit my changes. As expected, there were 6 tracked changes. The deletion of 3 files, and the addition of 3 others in the new directory. I hit 'stage all' (the plus button) and the above error was thrown. I attempted to add them all manually. While staging the additions went well, the deletions threw this error. The only option availble is to restore them. What's the correct way to do deletions so they're tracked correctly?

I found this SO post, which is closely related, but none of the solutions worked, at least with my described setup.

0

There are 0 best solutions below