Search code examples
gitvisual-studiobitbucketgitignore

Visual Studio Ignore .vs


So, I tried making a new project and using BitBucket. I wanted to push my newly created project to the repository. However somehow my .vs and my packages folders got commited as well. I was too late with adding my .gitignore file and also It still commits the .vs file. Could anyone help me please? Thank you

vscode pic

How can I remove those files from my repository and prevent this from happening in the future?


Solution

  • Here's a proper answer.

    1. Add .vs to .gitignore this will prevent it getting re-added again.
    2. Remove .vs from the git index but leave it on your file system. git rm -r --cached .vs
    3. Commit your updated .gitignore. git commit .gitignore.
    4. Push your changes.