Posts Tagged svn

Ignoring .svn directories with grep

Trying a recursive grep?
grep -RnH (string) (path) gets you all the occurrences of (string) in (path) with line numbers but if you’re working with an SVN folder, a bunch of hits will come up from the .svn folder. Thats pretty annoying… the fix is using the exclude flag.

grep --exclude *\.svn* -RnH (string) (path)


, , , , , , , , , ,


Recovering files and folders in SVN

To restore a file or folder from a previous revision (that has been deleted or modified):

svn cp svn://path/to/folder/or/file@rev /path/to/dest

The source has to be the full URI to the file or folder you wish to restore and the destination can simply be ‘.’ (this folder).

, , , ,

No Comments

Restoring files or folders in SVN

To recover a folder or a file in svn, you can use the copy command to copy the folder from the revision of the repository before the file or folder was deleted (or modified). The syntax can be a bit confusing but here’s how it can be done. The first flag -r (i’m not sure if you need this the way this command is formatted) specified the revision you copy from. The next argument is the source and it needs to be the full path to the file or folder you’re recovering followed by @ and the revision number. then the location the to copy the data to (which can be just . for this folder).


svn cp -r 111 https://server/svn/path/to/folder@111 .
svn ci -m "restored file or folder"

, , ,

1 Comment