Check one file from repository in SVN with a specific revision number

Problem

You have to edit one file from a repository but there are hundreds of files in that repository with possible hundreds of MB or GB worth of information. Not only that but you might need the file on a specific revision number.

You have tried

PHP:
    svn checkout http://svn.source/directory/file.fil

But this doesn't work.

Solution

You need to check out an empty directory from repository and then apply an update to the file you need.

PHP:
    svn checkout --depth=empty htt://svn.source/directory[php]

    Now you submit the update command for the file you need checked out

    [php]svn update file.fil

note, before running the svn update make sure you "cd" to the directory that you just checked out from svn "cd /directory".

finally if you want the file to a specific revision number all you have to do is run an update again with the revision number.

PHP:
    svn update -r### file.fil
No comments yet.

Leave a Reply