SVN Tips & Tricks

SVN Tips & Tricks

These are some the commands used for SVN.
Checkouts repo code via file protocal

svn co file://svn/PROJECT_NAME/ /TARGET_DIR/XYZ/
OR
svn checkout file://svn/PROJECT_NAME/ /TARGET_DIR/XYZ/

Checkouts repo code via http protocal

svn co --username USERNAME http://svn/PROJECT_NAME/ /TARGET_DIR/XYZ/
OR
svn checkout http://svn/PROJECT_NAME/ /TARGET_DIR/XYZ/

checkout repo code from external url

svn checkout http://localhost/repos/PROJECT_NAME/ --username=USERNAME --password=PASSWORD

Create new folder in repo

svn mkdir -m "ABC" http://svn/PROJECT_NAME/

Adding Files into repo

svn add test1.txt test2.txt

Update SVN repo

svn update

Commit svn revesion

svn commit

View SVN code as a regular directory

svn ls file:///home/user/svn

View SVN logs for repo

svn log file:///svn/PROJECT_NAME/

Created directory and commit code with comments

svn mkdir file:///svn/PROJECT_NAME/foo -m "Created dumb directory"

View svn logs in a checkouted repo

svn log

info about checkout repo

svn info

info from svn repo

svn info file:///svn/PROJECT_NAME

info from external svn repo

svn info file:///svn/PROJECT_NAME --username=USERNAME --password=PASSWORD

Update SVN to specific revision number

svn update -r 2

Update SVN to recent revision

svn update

Get the log from specific revision to head reversion

svn log file:///home/zalam/svn/ -v -r3:HEAD

Export SVN repo

svnadmin dump /svn/PROJECT_NAME/ > /ABC/XYZ.db
svn export /svn/PROJECT_NAME/ /ABC/XYZ

Import command via file protocol

svnadmin load /svn/PROJECT_NAME/ < /ABC/XYZ.db
svn import /svn/PROJECT_NAME/ file://ABC/XYZ

 
You can get more help from these links below
http://svnbook.red-bean.com/en/1.2/
http://maverick.inria.fr/~Xavier.Decoret/resources/svn/index.html
 
 

Share this post

Leave a Reply

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