27

How can I download single file from an SVN repository?

For example:

svn co http://server.com/svn/trunk/test.file test.file
svn: URL 'http://server.com/svn/trunk/test.file test.file' refers to a file, not a directory

But I can download directories in this way.

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
Max Frai
  • 57,874
  • 75
  • 193
  • 301

3 Answers3

41
svn export <URL> <PATH>

Path is optional

svn export

And for uploading a single file
svn import

Dan McClain
  • 11,490
  • 9
  • 46
  • 67
2

I don't think you can check out a single file.

If you just want the file and don't care about svn, you can use wget:

wget http://server.com/svn/trunk/test.file`

If you already checked out the trunk directory, and you are in your local copy, you can update a single file:

svn up test.file
Dagg Nabbit
  • 72,560
  • 18
  • 107
  • 141
1
svn checkout <url_of_big_dir> <target> --depth empty
cd <target>
svn up <file_you_want>
mcandre
  • 20,703
  • 18
  • 81
  • 144