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
Asked
Active
Viewed 5,648 times
2

Soheil Mamdouhi
- 21
- 1
- 3
-
possible duplicate of [Checkout one file from Subversion](http://stackoverflow.com/questions/122107/checkout-one-file-from-subversion) – crashmstr Mar 31 '14 at 12:55
2 Answers
3
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

Community
- 1
- 1

Patrice M.
- 4,209
- 2
- 27
- 36
-
1Checking out a single file is possible with TortoviseSVN gui client. – Jyotsna Saroha Mar 31 '14 at 06:27
-
Thanks for your answer. EXPORT command add file to my system but exclude that from SVN. i want checkout one file to my system not a directory because some files in repository directory have problem. how can i do that? :( – Soheil Mamdouhi Mar 31 '14 at 06:52
-
I edited the answer to do this with command line or TortoiseSVN client, please take a look above. – Patrice M. Apr 02 '14 at 13:21
-
It works, but i have a new problem with that command. The problem is: when i execute that command one time that's work correctly but when i execute that command for second time for another file in that folder previous file deleted how can i fix that? – Soheil Mamdouhi Apr 05 '14 at 06:41
-
I suppose if you choose to checkout a single file, then the .svn information is stored for that one file, so the previous file can't be kept around, it won't be monitored by svn. I would recommend you try -"-depth files" to get all the files in the svn folder (non-recursive), and just update+commit the ones you want. In that case, the .svn info will know of ALL the files immediately in that folder. – Patrice M. May 15 '14 at 18:09
-
1As a side note, this process resulted in a .svn directory in the target directory. This would be '\current\class' using the example. This .svn directory was created even though a parent directory is already an SVN versioned directory. – Thoth Mar 11 '21 at 13:27
0
Latest version(s) of TortoiseSVN allow to checkout a single file. You should try upgrading your TortoiseSVN and then try the same steps again.

Slav
- 27,057
- 11
- 80
- 104
-
Yes TortoiseSVN can do this in every version but i want do this in svn(command prompt) – Soheil Mamdouhi Apr 01 '14 at 15:40