Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code Git shows all changes on drive?

I am using Visual Studio Code 1.6.0 on a Macbook.

I'm finding that the VSC GIT is listing tons of changes - even ones that are not in my working folder?

When I hover over these I get a tooltip:

"This file is located outside the current workspace."

Please advise how I can remove all these from the GIT panel.

like image 851
Bender Rodriguez Avatar asked Nov 04 '16 08:11

Bender Rodriguez


People also ask

How do I get rid of all changes in Visual Studio Code?

There could be a set of changed files, which you don't want to commit and want to undo the changes that you have already performed. Select those files/folders and right click on them to open the Git context menu, where you can click Undo Changes... to discard them.

How do I see Git changes in Visual Studio Code?

To help you focus on your Git repository, Visual Studio has a Git Repository window, which is a consolidated view of all the details in your repository, including local and remote branches and commit history. You can access this window directly from either Git or View on the menu bar or from the status bar.


1 Answers

Here is how you can avoid such issues in VSCode

  • Go back to folder using cd ..
  • Check if git has been initialzed using git status
  • If yes, remove git tracking with command rm -rf .git
  • Repeat this until you reach your root directory
  • and reload your vs code to track current directory
like image 192
Suman Kharel Avatar answered Oct 14 '22 17:10

Suman Kharel