Showing posts with label SVN. Show all posts
Showing posts with label SVN. Show all posts

Tuesday, October 25, 2011

SVN Tutorial using Command Prompt


Update Trunk from Branch

1)     Create a working folder for trunk.
2)     Checkout trunk from the server.
svn checkout <Server URL> <Working Path>
3)     Merge branch to trunk in trunk’s working folder.
svn merge <Branch URL> <Working Path>
4)     Commit changes.
svn commit <Working Path> -m “<log>”
Note : If there is any conflicts while merging do a resolve
          svn resolve –R - -accept working <Working Path>

Create a New Tag & Branch from Trunk

1)     Now create a new branch (To work on next release. Create two branch, one for next version & one for a patch release on same version) and tags.
a.     Copy head trunk revision to new branch.
svn copy <Trunk URL> <Branch URL> -m “<log>”
b.    Copy head trunk revision to new tag.
svn copy <Trunk URL> <Tag URL> -m “<log>”

Delete files/folder from SVN Repository

1)     Delete command will be commited to the repository automatically.
svn delete <URL> -m “<log>”
2)     Multiple files/folders can be deleted simultaneously.
svn delete <URL1> <URL2> <URL3> ……. –m “<log>”

Using Local Repository for Training

1)     Create a new folder for SVN Repository.
2)     Create SVN Repository on the new folder created.
svnadmin create –fs-type fsfs <Repository Path>
3)     Export desired revision from the server repository for practice.
svn export –r <rev#> <ServerURL>
4)     Local repository is now ready for training.
Note: Examples for Path & URL format.
Path/URL
Examples
Path
C:\folder1\folder2……
URL - Server Repository
URL - Local Repository
File:///C:/folder1/folder2/folder3/.....