How to rename / move a project in Intellij Idea 12?
Solution 1
It seems that one has to right click on the project (after following the instructions to rename the Project), then choose Refactor -> Move to relocate project to the new location. I didn't find any solution to rename and move a project at once.
Solution 2
- Right click on project, then Refactor -> Rename... (shift+F6), set desired name
- Close IntelliJ
- Rename directory in your filesystem to your desired name
- In startup dialog select Open (or File -> Open... in main window)
- Please select renamed project directory
Enjoy, it work's for me!
Solution 3
- Close IntelliJ
- Rename the folder in Explorer (Windows) / Finder (OSX)
- Open IntelliJ
- Import Project from Dialog, or File -> Import Project
- Select the folder with the new name
- Follow the dialogues
Solution 4
- Go to
FilethenProject Structure - Under
Project Settings -> Projectmake sure that you change the project name. - Then under
Project Settings -> Moduleschange the name there as well. - Restart Intellij
- Use your File Explorer to confirm that the project/modules have been renamed.
Solution 5
If it is a gradle project, instead of renaming it using Refactor->Rename :
- set the
rootProject.namevariable in the settings.gradle file to the new project name. - reimport the project. Hit the 'Refresh all Gradle Projects' button in the Gradle Tool Window.
Then follow steps 2 to 5 in @Dawid's answer.
To remove the old project from IntelliJ's list of managed projects:
- select File->Open Recent->Manage Projects..
- click the 'x' next to the old project name
Comments
-
sheidaei 6 monthsAs stated here one can change the name of a project. However, it only changes the name of the project and it will not change the folder structure.
As an example if your project is called sample1 and it resides ~/user1/development/IdeaProjects/sample1, the folder location won't be changed to ~/user1/development/IdeaProjects/sample2 if one changes the project name to sample2.
-
Adam Toth about 8 yearsIt doesn't rename the project folder only moves it. So ultimately you probably have to do that manually
-
null almost 8 yearsAnswering with shortcut key is a bad answer as everyone can change the keymap. -
bolec_kolec almost 7 yearsThis doesn't help. It doesn't change of the project folder. Instead of this it creates a new one with a new name and moves there. The old folder of the project folder is inside a new one. -
Demian over 6 yearsDoes not work, all the module settings get reimported with Intellij best guesses
-
Tomáš Záluský over 5 yearsWorks for me in Idea 2017.1, just beware: (1) moving might be slow (I waited for approx. 15m for 471MB project with 16000+ files), (2) for one project, new git root was not detected (but it's easy to correct in Version Control Settings) -
z33k almost 5 yearsIt works...in a way. I mean this workaround let's you refactor both the IntelliJ metainfo and the folder structure on disk, but it doesn't address anything that probably stays in the main user configuration folder (~/.IdeaIC2017.3in my case). So anyone going with this solution is bound to be haunted by some ghost projects in some IntelliJ dialogues later -
stephanmg almost 3 yearsThe common sense answer. I think we should upvote this. (IJ 2019.3 Community)