145

I'm fairly new to linux and svn. I'm trying to checkout the trunk folder of a project into my public_html directory using this command (while in public_html):

svn checkout file:///home/landonwinters/svn/waterproject/trunk

The waterproject directory contains the files from untarring a base install of drupal.

It checks out fine, except all the files are in public_html/trunk instead of just being in public_html.

I don't know the command to move all the contents of trunk up to public_html and rm trunk, but I think I could figure that out relatively easily. I just want to know if I can just check out the contents of a folder, without the folder itself.

Zoe
  • 27,060
  • 21
  • 118
  • 148

4 Answers4

283

Just add a . to it:

svn checkout file:///home/landonwinters/svn/waterproject/trunk .

That means: check out to current directory.

nonopolarity
  • 146,324
  • 131
  • 460
  • 740
Sander Marechal
  • 22,978
  • 13
  • 65
  • 96
22
svn co svn://path destination

To specify current directory, use a "." for your destination directory:

svn checkout file:///home/landonwinters/svn/waterproject/trunk .
allaryin
  • 376
  • 1
  • 4
11

Just add the directory on the command line:

svn checkout svn://192.168.1.1/projectname/ target-directory/
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
10

Provide the directory on the command line:

svn checkout file:///home/landonwinters/svn/waterproject/trunk public_html
  • If you specify an existing directory it will create a new folder with the name of the root checkout directory there, while if you specify a non-existant folder, it will use that instead. – Casebash Feb 26 '10 at 03:27
  • You can avoid overriding files by renaming an existing directory, checking out and renaming it back again. – Casebash Feb 26 '10 at 03:28