git 我应该将 .idea/workspace.xml 添加到 gitignore 吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27647889/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:38:39  来源:igfitidea点击:

Should I add .idea/workspace.xml to gitignore?

gitwebstormgitignore

提问by CodyBugstein

When I try to checkout another branch, I get this error:

当我尝试结帐另一个分支时,出现此错误:

error: Your local changes to the following files would be overwritten by checkout:
        .idea/workspace.xml
Please, commit your changes or stash them before you can switch branches.
Aborting

I did some research and it seems some people avoided this problem by adding the afformentioned file to gitignore.

我做了一些研究,似乎有些人通过将上述文件添加到gitignore.

Is this a wise thing to do? If gitis ignoring your workspace.xmlfile, won't it mess up your experience in the IDE (in my case, Jetbrains Webstorm)?

这是明智的做法吗?如果git忽略你的workspace.xml文件,它会不会破坏你在 IDE 中的体验(在我的例子中是 Jetbrains Webstorm)?

回答by Pran

Based on JetBrainsyou should not place the workspace.xmland tasks.xmlin repo, as they contain user specific settings.

基于JetBrains,您不应将workspace.xmltasks.xml放在 repo 中,因为它们包含用户特定的设置。