Useful SVN Commands

svnadmin create REPOS_PATH - Create a new repositiry in the REPOS_PATH svnadmin create --fs-type fsfs /var/svn/repos - Create a new repositiry in the REPOS_PATH using fsfs system svnadmin create --fs-type bdb /var/svn/repos - Create a new repositiry in the REPOS_PATH using bdb system fsfs system - Changes noted against previous version bdb system - Changes noted against from initial version svn checkout URL - Creat a working copy of a repository svn add filename - To add file to working copy svn delete filename - To remove file from working copy svn copy foo bar - To make a copy of foo to bar and save it as svn change svn move foo bar - svn copy foo bar + svn delete foo svn mkdir dirname - To create a directory under working copy svn commit - Save the changes to svn repository with new revision svn commit --depth empty - Same as commit but only update the changes in the current level svn commit -m "message" - Same as commit but commits with message svn commit -f messageFile - Same as commit but commits with messag in messageFile svn update - Update Current working copy (Current path only, if need full update go to working copy home path) with HEAD version (U-updated, G-merged, C-Conflict) During conflict we can postpone the action. It will create multiple files with revision numbers. But before next commit have to resolve, otherwise cannot commit. svn resolve - If we postponed any conflicts to do svn resolve --accept working filename - accept my changed file as final copy and resolve svn resolve --accept theirs-full filename - accept HEAD version changed file as final copy and resolve svn status - Show the changes in the working copy from the initial checkout (No need connection to repository, with the help of .svn directory will be found) m-modified, a-added, d-deleted,c-conflict,?-not_in_svn svn status -v - Show all files versions even there is no change. svn status -v -u - Show all files versions by comparing with the repository HEAD version (Required connectivity to repository, * means change made to that file after checkout) svn diff - Show the content changes in detail for each file. (- deleted, + added) svn log - Shows comlete list of changes made to each revision for all files given file svn annotate filename - Full History of changes made to a file in line by line. svn revert filename - Revert the changes to working copy initial version. svn revert addedFile - Remove from Working Copy (check with svn status). svn revert deletedFile - Add back to Working Copy (check with svn status).

SVN Serve Setup

Note 1:
If we directly add directory or file to the working copy it will not be added to the repository when we commit. So either create directory or files directly the use command svn add file/directory name or create using svn add/ svn mkdir.

This entry was posted in Others and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.