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

查看:19
本文介绍了如何在 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. 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.

推荐答案

Code Style 可以是 复制到项目 并保存在 .idea/codeStyles 中成为 通过版本控制共享:

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

复制到项目 单击此按钮可在项目级别创建当前全局方案的副本.创建副本后,IntelliJIDEA 建议在项目层面改用这个新方案.

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天全站免登陆