简体   繁体   中英

VSCode Git commands and tracking changes

I'm using Visual Studio Code in Windows 10 and also have Git installed.

I have encountered two issues:

  1. I have tried to perform Git commands on the "command palette" (as shown on many VSCode tutorials) but VSCode is not recognizing any commands. I ended using the "integrated terminal" using bash.exe to clone my repository and checkout master . That did the trick and now I can see my project under the Explorer icon.

    Now that I have files and VSCode sees them if i try to use again the "command palette" to checkout or pull or commit it is not seeing my repository or branches or master. I have to go back and use the "integrated terminal".

    Why is the "command palette" not working?

  2. If I edit any of my files under the Explorer icon that I previously cloned and checkout the changes are not shown under the Git icon.

    But I've noticed that if I make changes to the settings.json (VSCode preference file) it shows under the Git icon that changes have been made and it asks me if I want to commit the changes.

    Why is it that VSCode is not tracking or showing the changes I've made on my own files and only track the changes on its own files?

Visual Studio Code "Version Control" page mentions:

Visual Studio Code has integrated Git support for the most common commands.

Note: VS Code will leverage your machine's Git installation, so you need to install Git first before you get these features. Make sure you install at least version 2.0.0

So make sure first Git for Windows is installed and in your %PATH% before launching Visual Studio Code.

Open VS in the root folder of your Git repo. As mentioned:

You can open VS Code in a sub-directory of a Git repository. VS Code's Git services will still work as usual, showing all changes within the repository, but file changes outside of the scoped directory are shaded with a tool tip indicating they are located outside the current workspace.

The OP fmora adds in the comments :

I need to open the folder via VSCode in the File menu and it works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM