1

How can I exclude the .history folder from the source control of vscode?

File history

I just want to commit the files themselves, not the changes in .history/.

kelvin
  • 1,421
  • 13
  • 28
Coder1
  • 25
  • 4

2 Answers2

2

Add ".history/" to a .gitignore file on the project root.

Example:

echo .history/ >>.gitignore

It might be helpful to also add it to vscode's files.exclude setting. From the plugin's project page:

Note

When .history folder is stored in workspace, you can add a "files.exclude". This hides .history folder and avoids some issues. (e.g. csproj extension) Thanks to @pabloarista (issue #13)

For that, see: How do I hide certain files from the sidebar in Visual Studio Code?

kelvin
  • 1,421
  • 13
  • 28
1

You can create a file called .gitignore (if one does not exist already) and then add .history/ to it, along with any other files or folders you would want git to ignore in commits.