Soheil Mamdouhi
Soheil Mamdouhi

Reputation: 31

Checkout a file in SVN

I want checkout a file in SVN but return that message to me "svn: E200007: URL 'svn://mcdssrv/repos/currecnt/class/MBackingBean.java' refers to a file, not a directiry". so, how can i resolve that?
My command is:
svn checkout svn://mcdssrv/repos/currecnt/class/MBackingBean.java d:\currecnt\class\MBackingBean.java

Upvotes: 3

Views: 6088

Answers (2)

Slav
Slav

Reputation: 27485

Latest version(s) of TortoiseSVN allow to checkout a single file. You should try upgrading your TortoiseSVN and then try the same steps again.

Upvotes: 1

Patrice M.
Patrice M.

Reputation: 4319

You can only checkout a directory, so:

svn checkout svn://mcdssrv/repos/currecnt/class/ d:\currecnt\class

If you want to avoid too many files/nested directories, you can use the --depth files or --depth immediates option.

If you just want the file, and not edit it / check it back in later, use svn export:

svn export svn://mcdssrv/repos/currecnt/class/MBackingBean.java d:\currecnt\class

[Edited] That being said, as someone (@jyotsna-saroha) commented below, TortoiseSVN manages to do it, and someone has proposed a clever workaround.

Basically, you have to do

svn --depth empty checkout svn://mcdssrv/repos/currecnt/class/ d:\currecnt\class
cd d:\currecnt\class\
svn update MBackingBean.java

Upvotes: 4

Related Questions