在JetBrains工具中,如何在多个开发人员之间共享IDE和项目设置? [英] In JetBrains tools, how can I share IDE and project settings between multiple developers?

查看:465
本文介绍了在JetBrains工具中,如何在多个开发人员之间共享IDE和项目设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢JetBrains工具.但是,我找不到与团队成员有效共享IDE级别和项目级别的设置的方法.到目前为止,我已经按照JetBrains网站上一篇文章提供的说明进行操作,该文章标题为如何在版本控制系统下管理项目" .但是,对本文的许多评论警告不要将其实现为共享项目设置的方法.而且我在使用该方法时遇到了一些问题,即不是我想要共享的所有内容实际上都与团队成员共享.

I love the JetBrains tools. But, I can't find a way to effectively share settings at the IDE level and the project level with team members. To date, I've followed instructions provided by an article on the JetBrains site, titled "How to manage projects under Version Control Systems". But, many comments on the article warn against implementing it as a method for sharing project settings. And I've run into a few issue with the method, namely not everything I'd like to be shared, is actually shared with team members.

我还尝试使用在 JetBrains工具的文件"->设置存储库" 菜单.它在用户之间共享一些设置,我喜欢它自动创建对Git存储库的提交,但是它并不共享所有设置.共享的设置效果很好!但是,设置存储库"功能似乎正在开发中.

I've also tried using the function found under the File->Settings Repository menu of the JetBrains tools. It shares some settings between users, and I like that it automatically creates commits to the Git repo, but it doesn't share all the settings. The settings that are shared work great! But, it seems like the "Settings Repository" feature is a work in progress.

我已经阅读了许多关于此主题的讨论,但是在使用IDEBrains工具共享IDE级别设置以及同时投影特定设置方面,没有明确的答案.更不用说,我使用多种JetBrains工具(PhpStorm,PyCharm,WebStorm和IntelliJ).如果有一种解决方案也可以在所有工具之间共享设置,我会很高兴,因为有些设置是所有JetBrains工具中的全局设置,有些是特定于特定工具的,有些是特定于项目的.

I've read many discussions on this topic, but no definitive answer on a way to share IDE level settings and, at the same time, project specific settings when using the JetBrains tools. Not to mention, I use a multiple JetBrains tools (PhpStorm, PyCharm, WebStorm and IntelliJ). I'd like it if there were a solution that also shared settings between all the tools, because some settings are global across all JetBrains tools, some are specific to a particular tool, and some are specific to a project.

JetBrains工具之间的共享设置更像是一个不错的选择".我真正需要知道的是,如何在团队成员之间轻松共享全局IDE设置和项目级别设置.但是,我会向所有能同时找出两者的人致以敬意. :-)

Sharing settings between JetBrains tools is more of a "nice to have". What I really need to know is, how can I share global IDE settings and project level settings easily between team members. But, I'll give mad respect points to anyone who can figure out both. :-)

推荐答案

我终于找到了几分钟,写下了答案.我想写一个更完整的答案,但是最近我一直忙得不可开交,所以现在必须这样做.

I finally found a few minutes to write up an answer to this. I want to write up a more complete answer, but I've been incredibly busy lately so this will have to do for now.

此解决方案描述了我用来共享PyCharm项目的代码和设置的内容.此解决方案有一个警告,我将尝试描述和详细说明解决方法.

This solution describes what I've been using to share code and settings of PyCharm projects. There is one caveat to this solution, which I'll attempt to describe and detail a work-around for.

按照JetBrain知识库上的说明,我们将整个项目文件夹添加到Git存储库中.但是,在这样做之前,请确保通过在项目目录中创建.gitignore文件并至少添加以下行来至少排除workspace.xml文件:

Following the instructions on JetBrain's knowledge-base, we'll add the entire project folder to a Git repo. But, before doing so, be sure to exclude at least the workspace.xml file by creating a .gitignore file in the project directory and add at least the following line:

.idea/workspace.xml
# JetBrains also recommends  adding tasks.xml, but I found it useful to
# share tasks with team members.
# Uncomment the following line to avoid sharing tasks with team members
# .idea/tasks.xml

您肯定要在.gitignore中添加workspace.xml,因为它存储了所有本地窗口大小,调试面板布局等.我的团队发现同步工作非常有用,这样我们就可以协调工作.但是,每个团队的工作方式都不一样,因此请您自行决定.

You'll definitely want to add workspace.xml to .gitignore because it stores all of your local window sizes, debug panel layouts and the like. My team found it useful to syncronize our tasks, so that we could coordinate work. But, every team works differently, so use your own discretion.

项目和个人偏好存储在三个主要位置:

There are three main locations project and personal preferences are stored:

  1. <project_directory>/.idea包含项目特定的设置.
  2. $HOME/.PyCharmYYYY.M/config包含由PyCharm管理的所有项目的选项(或用"PyCharm"替代任何其他JetBrains工具).
  3. 如果使用文件"->设置存储库"中的共享设置,则$HOME/.PyCharmYYY.M/config将包含通过JetBrain的内置共享设置"功能共享的所有设置.我和我的团队对此并不在意,因为它似乎会自动共享一些我们不想要的东西(例如颜色主题和键映射).而且我们无法选择一组子选项来共享整个团队.长话短说,它没有给我们我们所需的灵活性和控制力.
  1. <project_directory>/.idea contains project specific settings.
  2. $HOME/.PyCharmYYYY.M/config contains options for all projects managed by PyCharm (or substitue "PyCharm" for any other JetBrains tool).
  3. If you use the shared settings found in File->Settings Repository, $HOME/.PyCharmYYY.M/config will contain all of the settings shared via JetBrain's built in "shared settings" function. I and my team didn't care for it, because it seemed to automatically share some things we didn't want to (like the color theme, and key mappings). And we weren't able to select a sub-set of options to share team-wide. Long story short, it didn't give us the flexibility and control we need.

我们确实尝试同时使用选项1和3,但这太笨拙了.例如,一个人将更改字体,并且在我们下次重新启动JetBrains时,它将更改整个团队的字体.真是一团糟.如果您确实决定尝试使用选项1和3,则我建议您格外小心.

We did try using options 1 and 3 at the same time, but it was too unwieldy. For example, one person would change a font, and it would change it for the whole team the next time we re-launched JetBrains. It was a mess. If you do decide to try out using options 1 and 3, I recommend proceeding with extreme caution.

目前,我们仅使用选项1,并且效果很好.

Presently, we are using only option 1, and it's working out quite nicely.

您可能要在.gitignore文件中添加或删除的其他一些值得注意的文件夹是:

A few other notable folders you might want to add or remove from the .gitignore file are:

  • <project_folder>/.idea/runConfigurations/包含用于运行鼻子测试和调试代码的所有调试和运行配置.
  • <project_folder>/.idea/scopes/包含所有用于将项目文件视图过滤到更多管理分组的范围.
  • $HOME/.PyCharmYYYY.M/options包含您正在使用的PyCharm版本的所有全局选项.例如,配色方案,键映射和任何其他非项目特定的选项.有关其他全局设置的完整列表,请参阅此JetBrains文章或以下摘录:
  • <project_folder>/.idea/runConfigurations/ contains all of your debug and run configurations used to run nose tests and debug into your code.
  • <project_folder>/.idea/scopes/ contains all of the scopes used to filter your view of the project files, into more management groupings.
  • $HOME/.PyCharmYYYY.M/options contains all of the global options for version of PyCharm you're using. For example, the color scheme, key mappings and any other non-project specific options. For a full list of other global settings, see this JetBrains article, or the following excerpt:

这篇关于在JetBrains工具中,如何在多个开发人员之间共享IDE和项目设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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