天天看點

idea svn分支與分支合并,IntelliJ IDEA中多個SVN分支的工作流程

idea svn分支與分支合并,IntelliJ IDEA中多個SVN分支的工作流程

I'd like to easily switch between SVN trunk and one or a few feature branches using IntelliJ IDEA, preferably being able to work on multiple branches concurrently. I have some "local" configuration like database settings for integration tests and debug-logging enabled that I'd like to keep using and not commit to SVN.

What are the pros and cons of the various options, is there one way which easily beats the others? Here are some possible approaches I can think of, any more?:

Using the "SVN - Update Directory" to swap out the current branch for another.

Won't allow working on multiple branches concurrently.

Creating a module per branch in a single project.

Seems to cause issues with clicking on stacktraces/class names going to the wrong module, easily accidentally search across modules by accident and such?

Creating a separate IntelliJ project per branch.

More redundant with separate settings per project, more work to keep everything in sync between the projects. Less risk of accidentally working with the wrong branch.

解決方案

I have the best experience with

Creating a separate IntelliJ project per branch

Pros

Very quick switch between branches.

You can have open more branches in same time.

Cons

You have to setup idea project for every branch.

Usable only for limited count of branches.

I have one project for trunk version and other project for current production version.

When you have more branches then two, first option is better idea I think.