Thursday 30 June 2016

Top 10 SVN commands with Examples

Top 10 SVN commands with Examples

SVN Checkout
Checkout command is used to download sources from SVN repository to working directory. Syntax: svn checkout/co URL PATH
URL: Full URL of Repot
PATH: Path where you want to get the checkout
svn co .

SVN List
Lists directory and files entries. Syntax: svn list
svn list

Add a new file to SVN repository. Syntax: svn add filename.php
svn add myfile.php
Need to commit
svn commit -m "Adding a myfile.php file" myfile.php

SVN Commit
Commit the file from local to Repo. Syntax: svn commit
svn commit -m "This is message"

SVN delete
Delete a new file From SVN repository. Syntax: svn delete filename.php
svn delete filename.php
Need to comit
svn commit -m "deleting a myfile.php file" myfile.php

SVN up
Upload all file to server. Syntax: svn up
Upload All files
svn up

Upload one file
svn up filename.php

Upload multiple file
svn up filename2.php, filename.php

SVN logs
View the svn log for single file Or mutiple file. View top 25 logs for all files
svn log

View top logs for filename.php
svn log filename.php

check the log for particular revision number
svn log -r 825

SVN Move
Rename or move a file from one directory to another. Syntax: svn move
svn move filename.php newFilename.php

SVN update
svn update command brings changes from the repository into your working copy.
Syntax: svn update
Get all updates
svn update

Get file update
svn update filename.php