# 在机器之间同步 Intellij IDEA 配置

在配置同步之前，首先有几个外部依赖需要解决：1. 使用的同步服务，这里我推荐使用[Dropbox](https://db.tt/isyvu6ny) 2. 明确本地 Intellij IDEA 配置存储的路径

## 配置Intellij IDEA从同步文件夹读取配置

在之前[IDEA 各个目录作用](https://einverne.gitbook.io/intellij-idea-tutorial/installation-directory-introduce) 中提到 config 目录：

> `config` 目录是 IntelliJ IDEA 个性化化配置目录，或者说是整个 IDE 设置目录。这个目录主要记录了：IDE 主要配置功能、自定义的代码模板、自定义的文件模板、自定义的快捷键、Project 的 tasks 记录等等个性化的设置。

在 `Help | Edit Custom Properties` 中开启自定义的属性

然后指定

```
# custom IntelliJ IDEA properties
idea.config.path=~/Dropbox/IntellijIdea2018/config/
idea.log.path=/tmp/IntellijIdea/
```

修改 `idea.properties` 属性文件中的 `idea.config.path` 值

建议同步时只同步 conf 文件夹， system 中包含一些缓存会很大，这是我们本地的大小：

```
212M    ./config
956M    ./system
1.2G    .
```

## 在新机器中使用相同的方法

导入配置文件夹

## 使用 IntelliJ IDEA 自建的同步

在 File -> Settings Reposotory 中使用 git ropo 来同步文件，第一次选择 Overwrite Remote，然后 IDE 就会自动将设置push到远程仓库中。

## reference

* <https://www.vojtechruzicka.com/intellij-idea-tips-tricks-synchronization-sharing-settings>

更多的 tip 可以访问: <https://www.vojtechruzicka.com/tags/idea/>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://einverne.gitbook.io/intellij-idea-tutorial/sync-settings-between-machines.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
