Subversion - How to bind an existing project? How to replace?

I'm converting from Eclipse and it's quite easy with the Subversive plugin to either bind a code base with a Subversion trunk or to replace your local completely with what's in Subversion.  This, however, elludes me in IntelliJ's Subversion support.

How can I do the following:

  1. Bind an existing project that is not currently connected to SVN to a project that exists in SVN.
  2. Import an existing checked out project (say from TortoiseSVN) into IntelliJ
  3. Update *and Overide* your local with what's in SVN (replace)


TIA,
Lou

5 comments

1) Do you mean you start a new project in IntelliJ and you want to put that in Subversion? If so, use Version Control->Import into Subversion. I believe IntelliJ does an import and then an immediate checkout transparently (although I am not 100% sure as I do most of this at the command-line)
2) If your code is a working copy that has been checked out from Subversion  then IntelliJ will automatically see that (by seeing the  .svn directories in the working copy) when you create a new project. File->New Project and point the wizard to the top-level of the working copy of your project. I usually use the "from scratch" option even for existing sources. Gives me more control over project layout.
3) Revert your changes and then Version Control->Update Project

0

No, I mean I checked out a project originally with TortoiseSVN and then I opened it IntelliJ.  How can I get IntelliJ to recognize the .SVN folders so I can get the SVN options in the context menu.

Version Control->Update will cause you to merge.  I simply want to replace.  I suppose though I could just delete the project and get it again from the repo, but in Eclipse you can do "Replace with a particular with latest" from the HEAD or even get a particular revision.

1

IntelliJ will automatically recognize the files as being under Subversion control, no configuration needed. I always checkout from the command line and then open in IntelliJ and IntelliJ always correctly sees that the files are under revision control.

Just plain replacing a file from version control seems like a very uncommon use case.  However, if you need to do it you can delete the file in IntelliJ (make sure to answer NO when IntelliJ asks if you want to schedule it for deletion from Subversion) and then do an update. Subversion will restore the file.

0

Hmmm...that's what I did but I don't see Subversion in the context menu for this particular project I opened.  I'll take a closer look but it's good to know that it should do this.

1

There are two things I can think of for you to check.

1) Make sure you didn't inadvertently uninstall/disable the Subversion Integration plugin. This plugin is installed by default but you can delete/disable it. File->Settings->Plugins->Installed Tab (check for Subversion Integration here and make sure it is checked)
2) Go to File->Settings->Version Control and check to make sure Subversion is the selected VCS for <Project Root>. This is the setting that IntelliJ should be setting on its own based on the existence of the .svn directories. I would be curious to see what this screen says. (assuming the Subversion Integration from #1 is installed and enabled).

1

Please sign in to leave a comment.