Search code examples
gitvisual-studio-code

Visual Studio Code: .git folder/file hidden


I am trying Visual Studio Code at this moment. Everything about Visual Studio Code look really cool to me except one thing: .git folder/file is hidden in Visual Studio Code.

I often change Git setting by modifying the .git configuration file. It is really annoying for me not able to see .git files.

Is there a way to reveal .git files in Visual Studio Code?


Solution

  • By default Visual Studio Code excludes files in a folder using the following settings:

    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/.DS_Store": true
    }
    

    You can change your user settings or workspace settings to show the .git folder by adding these lines:

    "files.exclude": {
         "**/.git": false
    }
    

    This setting can also be found in Text Editor -> Files -> Exclude if you are using the settings GUI.


    To open the settings JSON for editing, do the following:

    1. Open the command pallete:

      Windows: ctrl+shift+p

      or

      Mac: ⌘ + Shift + P

    2. In the command prompt that should open, type Preferences: Open Workspace Settings (JSON).

      This should open the settings JSON file for you.

      Note: You will notice similar commands appear if you prefer to choose settings more specific to your user or workspace.

    3. Find files.exclude and you should see the relevant section to edit.