-2

So i accidently pushed the ".vscode" folder to the github repository. I want it to be deleted from github.

I made a gitignore file and added the name ".vscode" in it so that it won't be tracked and i also tried delteing it using the git rm .vscode --cached command and it says fatal: not removing '.vscode' recursively without -r Now i do not understand what it says. My question is simply how do i delete the .vscode folder from my github repository. I tried searching on internet but could not find anything.

  • 3
    Just as the error tells you: you are missing the parameter -r, which is needed for recursively removing a directory. – Seabyte Feb 26 '23 at 19:16
  • https://stackoverflow.com/search?q=%5Bgit%5D+rm+recursively – phd Feb 26 '23 at 20:04
  • Note that since the commit with vscode directory is already pushed, it will remain on GitHub forever. Nothing short of a history rewrite or repo deletion can remove it. – matt Feb 26 '23 at 22:33

1 Answers1

-1
  1. Remove .vscode from .gitignore
  2. Remove .vscode from your local repository by running the following command in the terminal while in the repository directory: rm -rf .vscode
  3. Commit this change and push to github
  4. Return back .vscode to .gitignore, commit the change, and push it to github.
Invulner
  • 842
  • 2
  • 11
  • That won't actually delete the already pushed directory from GitHub, as the user has asked. – matt Feb 26 '23 at 22:32