Visual Studio Code: .git folder/file hidden

后端 未结 6 1261
迷失自我
迷失自我 2021-01-30 02:20

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 C

相关标签:
6条回答
  • 2021-01-30 02:22

    You should also be aware of the search.useIgnoreFiles setting, which will ignore files and folders that are ignored using .gitignore and .ignore files.

    0 讨论(0)
  • 2021-01-30 02:32

    The settings for Visual Studio Code can be found:

    • On a Windows or Linux computer, click menu FilePreferencesSettings
    • On a Mac, click menu CodePreferencesSettings

    There are both users settings (for everyone) and workspace settings for individual projects.

    More instructions can be found at: User and Workspace Settings

    0 讨论(0)
  • 2021-01-30 02:34

    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
    }
    
    0 讨论(0)
  • 2021-01-30 02:40

    You can access this setting in the settings option.

    Then we need to copy this particular settings section to the right side and make the changes.

    0 讨论(0)
  • 2021-01-30 02:43

    The below steps can be followed to override the existing user setting:

    1. Menu CodePreferenceSetting
    2. Search for files.exclude
    3. Mouse over files.exclude property, click on the edit icon and then opt for the copy to settings.
    4. The above steps will add all the properties, but keep only those which need to be overridden. For this case: it should be, "files.exclude": { "**/.git": false }
    5. Close the user setting. the .git folder will automatically appear in the respective repository.
    0 讨论(0)
  • 2021-01-30 02:44

    It's probably best to leave this hidden

    If you are using the sidebar to navigate and edit files, it would leave an opportunity to accidentally drop a file or folder in it, or accidentally move it to a different location. A better solution would be to open a terminal session in Visual Studio Code and then do code .git. That will open the folder in another Visual Studio Code instance and from there you can edit it.

    0 讨论(0)
提交回复
热议问题