Showing posts with label svn. Show all posts
Showing posts with label svn. Show all posts

Tuesday, September 26, 2017

SVN cheat sheet

SVN cheat sheet


This is not the place to learn SVN commands, Im just creating this as a  reference to some important commands.

Revert local file change

svn revert <file_name>

Take a diff from two revisions

svn diff -r <old_revision>:<new_revision>

Update to the latest revision

svn update "<path>"

Update to a specific revision

svn update -<revision_number> "<path>"

Add new files/directory to track

svn add <file_name>|<directory_name>

Delete with a message

svn -m "<messahe>" delete "<path>"

download file now

Read more »

Monday, September 11, 2017

SVN Dump Parts Of A Repository

SVN Dump Parts Of A Repository


Assuming the following SVN repo structure:
- repository root
| - project1
| - project2
| - project3
To dump the project1 history into a portable, re-creatable format, first you use svnadmin dump, like this:
svnadmin dump [path to repo] > repo.dump
Which creates a dump of the entire repository into a file called repo.dump. This might take some time and is CPU intensive so it would be best to perform this outside of normal work hours...
Then use svndumpfilter to filter just for the project1 folder (see folder tree above):
svndumpfilter include project1 < repo.dump > project1.dump
If you have nested repositories, then it breaks with a syntax error. To get around this you need to run the dump multiple times using the �exclude� directive until you have what you want:
svndumpfilter exclude project2 < repo.dump >> project1.dump
svndumpfilter exclude project3 < project1.dump >> project1.dump
At the end you get a full svn repository that could be re-created anywhere, like this:
svnadmin create /var/svn/project1svnadmin load /var/svn/project1 < project1.dump
mkdir -p ~/workingcopies/project1svn co file:///var/svn/project1~/workingcopies/project1/

download file now

Read more »