如何使用svn export
命令从存储库中获取单个文件?
我试过这个:
svn export e:\repositories\process\test.txt c:\
但是我收到了这个错误:
svn:e:\ repositories \ process不是工作副本
答案 0 :(得分:55)
从您的目录名称猜测,您正在尝试访问本地文件系统上的存储库。您仍然需要使用URL语法来访问它:
svn export file:///e:/repositories/process/test.txt c:\test.txt
答案 1 :(得分:19)
您也不必在本地执行此操作。您可以通过远程存储库执行此操作,例如:
svn export http://<repo>/process/test.txt /path/to/code/
答案 2 :(得分:4)
对于受损的替代品,这里是从GitHub.com到本地目录的真实例子:
svn ls https://github.com/rdcarp/playing-cards/trunk/PumpkinSoup.PlayingCards.Interfaces
svn export https://github.com/rdcarp/playing-cards/trunk/PumpkinSoup.PlayingCards.Interfaces /temp/SvnExport/Washburn
有关详细信息,请参阅:Download a single folder or directory from a GitHub repo。
答案 3 :(得分:1)
I know the OP was asking about doing the export from the command line, but just in case this is helpful to anyone else out there...
You could just let Eclipse (plus one of the plugins discussed here) do the work for you.
Obviously, downloading Eclipse just for doing a single export is overkill, but if you are already using it for development, you can also do an svn export
simply from your IDE's context menu when browsing an SVN repository.
Advantages:
答案 4 :(得分:0)
使用SVN存储库URL将文件导出到本地路径。
svn export [-r rev] [--ignore-externals] URL Export_PATH
svn export http://<path>/test.txt C:\Temp-Folder