Checkout One File from SVN

A Slik SVN/PowerShell workaround for the SVN missing feature - checking out just a few select files instead of the entire folder.
$svnFolder = 'https://dev.co.com/svn/project1'
$workingFolder = 'c:\temp\svn'
$file = 'foo.cs'

#checkout just the folder, checkout depth "only this item"
&svn checkout $svnFolder $workingFolder --depth=empty

#method 1: cd to working folder, update using file name
cd $workingFolder
&svn update $file

#method 2: update using file full path name
$file = join-path $workingFolder $file
&svn update $file

No comments:

Post a Comment