Friday, 4 December 2015

Subversion Commands

Checkout a new repository.
svn co REPO_URL

See differences between working copy and repo in all files
svn diff

See the difference between working copy and repo for a specific file
svn diff path/to/file

See the difference between working copy and specific revision for all files
svn diff -r REVISION_NUMBER

See the difference between working copy and specific revision for a specific file
svn diff path/to/file -r REVISION_NUMBER

Take the latest code from repo in working copy
svn up

Take the latest code of a specific file from repo in working copy
svn up path/to/file

Take the code from repo in working copy from a specific revision
svn up -r REVISION_NUMBER

Take the latest code of a specific file from repo in working copy from a specific revision
svn up path/to/file -r REVISION_NUMBER

View a file of a specific revision number
svn cat path/to/file -r REVISION_NUMBER

Commit all changes to repo
svn ci -m"Commit Message"

Commit Few files to repo
svn ci -m"Commit Message" path/to/file1 path/to/file2 ....... path/to/fileN

Add a file/folder to svn for versioning
svn add path/to/(file/folder)

Remove a file/folder from versioning
svn rm path/to/(file/folder)

Add entire current folder for versioning
svn add .
(Notice the dot -  meaning current directory)

See revision number and other details of working copy
svn info
You may need to take latest code(svn up) to see this correctly

See full log since the first commit
svn log

See full log since the first commit along with the files committed in the revision
svn log -v

See log of a specific revision
svn log -rREVISION_NUMBER

See log of a specific revision along with the files committed in the revision
svn log -rREVISION_NUMBER -v

See log from and to a specific revision
svn log -rREVISION1:REVISION2

See log from and to a specific revision along with the files committed in the revision
svn log -rREVISION1:REVISION2 -v