我应该将 .vscode 文件夹提交到源代码管理吗? [英] Should I commit the .vscode folder to source control?

查看:49
本文介绍了我应该将 .vscode 文件夹提交到源代码管理吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.vscode 文件夹是否要提交给源代码管理?

Is the .vscode folder meant to be committed to source control?

在一个新的项目中,文件夹是空的,除了 settings.json 文件.什么样的东西会进入这个文件夹?它是特定于机器的,特定于开发人员的,例如 .vs 文件夹,因此不会被提交?还是应该让所有开发者共享这个文件夹并提交?

In a fresh project, the folder is empty, except the settings.json file. What kind of things would go into this folder? Is it machine-specific, developer-specific like the .vs folder and thus not be committed? Or should all developers share this folder and thus it should be committed?

文件顶部的注释 .vscode/settings.json 指出:

The comment at the top of the file .vscode/settings.json states:

// Place your settings in this file to overwrite default and user settings.
{
}

这似乎意味着该文件夹应包含项目特定的设置,因此应包含在源代码中.另外,这篇关于 UserVoice 的帖子 似乎暗示一些类型会进入那里,也暗示它应该被提交.

This seems to imply that the folder should contain project-specific settings and thus be included in source. Also, this post on UserVoice seems to imply some typings would go in there, also suggesting that it should be committed.

推荐答案

如果您想与团队共享设置、任务配置和调试配置,请检查 .vscode 文件夹.我认为如果您想在团队中强制执行设置,通常与团队共享设置(例如空格与选项卡)是有意义的.我们 VS Code 团队也共享特定于调试和任务的设置,因为我们希望我们的团队拥有相同的 VS Code 调试目标和任务目标集.

Check in the .vscode folder if you want to share settings, task configuration and debug configuration with the team. I think generally it makes sense to share settings (e.g. whitespace vs tabs) with the team if you want to enforce settings in a team. We in the VS Code team share debug and task specific settings as well because we want our team to have the same set of debug targets and task targets for VS Code.

顺便说一句,您的项目中不需要 .vscode 文件夹进行设置.您还可以在用户级别配置设置.

Btw you do not need to have a .vscode folder in your project for settings. You can also configure settings on a user level.

这篇关于我应该将 .vscode 文件夹提交到源代码管理吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆