domingo, 21 de noviembre de 2010

Extracting modified files from a Subversion Project

Sometimes you work on a project but don´t want to commit the changes but also want to take the changes with you to another computer.
Here´s a little trick for linux and Mac. On a terminal move to your versioned project directory and type
svn status | grep ^[AM\?] | awk  '{print $2}' | zip ../backup_`date +"%Y%m%d_%H%M"` -@

This will zip all added (A), modified (M) and new (?) files to a file named backup_20101117.zip with the directory structure
To unzip it:
tar xvf /path/to/zip/backup_20101117.zip -C /path/to/project

If you´re using Windows…. Be afraid, be very afraid. Nah just kidding you can install Cygwin (http://www.cygwin.com ) and use this trick.

No hay comentarios:

Publicar un comentario