如何在IntelliJ中的开发人员之间共享代码样式设置 [英] How to share Code Style settings between developers in IntelliJ

查看:125
本文介绍了如何在IntelliJ中的开发人员之间共享代码样式设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我团队中的所有开发人员都使用相同的默认代码样式设置。我们都使用IntelliJ 11+作为我们的IDE,我们使用git作为源控制系统。

I would like all developers on my team to use the same default code style settings. We all use IntelliJ 11+ as our IDE and we use git as our source control system.

确保它们全部使用相同设置的最简单方法是什么?我认为有一种方法可以将样式设置检入项目并让他们的编辑自动发现它们,但情况似乎并非如此。

What is the easiest way to make sure they're all using the same settings? I thought there would be a way to check in the style settings into the project and have their editors discover them automatically, but that doesn't seem to be the case.

PS。我不介意开发人员是否有意识地使用他们自己的偏好覆盖某些默认设置,但我确实希望我们至少从一组常见的默认设置开始。

PS. I don't mind if developers consciously override some of the default settings with their own preferences, but I do want to make sure that we all at least start from a common set of default settings.

推荐答案

代码样式可以是复制到项目并保存在 .idea / codeStyleSettings.xml 通过版本控制共享

Code Style can be copied to project and saved in .idea/codeStyleSettings.xml to be shared via version control:


复制到项目单击此按钮可将当前全局方案的副本创建到项目级别。创建副本后,IntelliJ
IDEA建议在项目级别切换到这个新方案。

Copy to Project Click this button to create a copy of the current global scheme to the project level. After creating the copy, IntelliJ IDEA suggests to switch to this new scheme at the project level.

这篇关于如何在IntelliJ中的开发人员之间共享代码样式设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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