Version Control with Subversion: Tortoise SVN – II
Version control with Subversion: Tortoise SVN - II
I am back again with your demand for SVN commands. This time, we will go through all usual commands which may be needed while using SVN :).
So, let’s not waste our time, and let’s go and check the commands one by one.
svn help
The name itself suggests ‘HELP’. Yes, it will assist the new/old user to use SubVersion. There are a lot more subcommands like checkout, commit, update, add, blame, revert, relocate, resolve, … etc., which can be used with svn help
like svn help
to get individual brief details for that subcommand.<
subcommand>
svn ls <URL of Repo> OR svn list <URL of Repo>
This command will list all the directories or files list, in the repository.
Options
-r [--revision] ARG
->ARG
(some commands also takeARG1:ARG2
range), a revision argument can beNUMBER
(revision number),DATE
(revision at start of the date),HEAD
(latest in repository),BASE
(base rev of item’s working copy),COMMITTED
(last commit at or beforeBASE
),PREV
(revision just beforeCOMMITTED
)-v [--verbose]
-> Print extra information-R [--recursive]
-> Descend recursively, same as –depth=infinity--depth ARG
-> Limit operation by depthARG
(‘empty’, ‘files’, ‘immediates’, or ‘infinity’)--incremental
-> Give output suitable for concatenation--xml
-> Output in XML
svn co <URL of Repo> OR svn checkout <URL of Repo>
This command will checkout a working copy from the given repository.
Options
-r [--revision] ARG
->ARG
(some commands also takeARG1:ARG2
range), a revision argument can beNUMBER
(revision number),DATE
(revision at start of the date),HEAD
(latest in repository),BASE
(base rev of item’s working copy),COMMITTED
(last commit at or beforeBASE
),PREV
(revision just beforeCOMMITTED
)-q [--quiet]
-> Print nothing, or only summary information--depth ARG
-> Limit operation by depthARG
(‘empty’, ‘files’, ‘immediates’, or ‘infinity’)--force
-> Force operation to run--ignore-externals
-> Ignore externals definitions
svn up <URL of Repo> OR svn update <URL of Repo>
This command will help to update the working copy, which will finally sync with the Subversion repository.
Options
-r [--revision] ARG
->ARG
(some commands also takeARG1:ARG2
range), a revision argument can be one ofNUMBER
(revision number),DATE
(revision at start of the date),HEAD
(latest in repository),BASE
(base rev of item’s working copy),COMMITTED
(last commit at or beforeBASE
),PREV
(revision just beforeCOMMITTED
).--depth ARG
-> Limit operation by depthARG
(‘empty’, ‘files’, ‘immediates’, or ‘infinity’)--set-depth ARG
-> set new working copy depth toARG
(‘exclude’, ‘empty’, ‘files’, ‘immediates’, or ‘infinity’)-q [--quiet]
-> Print nothing, or only summary information--diff3-cmd ARG
-> UseARG
as merge command--force
-> Force operation to run--ignore-externals
-> Ignore externals definitions--changelist [--cl] ARG
-> Operate only on members of changelistARG
--editor-cmd ARG
-> UseARG
as external editor--accept ARG
-> Specify automatic conflict resolution action (‘postpone(p)
’, ‘working
’, ‘base
’, ‘mine-conflict(mc)
’, ‘theirs-conflict(tc)
’, ‘mine-full(mf)
’, ‘theirs-full(tf)
’, ‘edit(e)
’, ‘launch(l)
’)--parents
-> Make intermediate directories
svn add <File Name>
This command will help to add files or directories, subdirectories or symlinks to repositories.
Options
--targets ARG
-> Pass contents of fileARG
as additional args--depth ARG
-> Limit operation by depthARG
(‘empty
’, ‘files
’, ‘immediates
’, or ‘infinity
’)-q [--quiet]
-> Print nothing, or only summary information--force
-> Force operation to run--no-ignore
-> Disregard default and svn:ignore property ignores--auto-props
-> Enable automatic properties--no-auto-props
-> Disable automatic properties--parents
-> Add intermediate parents
svn delete <File Name>
This will help users to delete an item from working copy or working repository.
Options
--force
-> Force operation to run-q [--quiet]
-> Print nothing, or only summary information--targets ARG
-> Pass contents of fileARG
as additional args-m [--message] ARG
-> Specify log messageARG
-F [--file] ARG
-> Read log message from fileARG
--force-log
-> Force validity of log message source--editor-cmd ARG
-> UseARG
as external editor--encoding ARG
-> Treat value as being in charset encodingARG
--with-revprop ARG
-> Set revision propertyARG
in new revision using the name[=value] format--keep-local
-> Keep path in working copy
svn copy <From File Path> <To File Path>
This command is required to copy a file or directory in a working copy or in the repository. It needs two paths as arguments, one is from file path and another is to file path.
Options
-r [--revision] ARG
->ARG
(some commands also takeARG1:ARG2
range), a revision argument can beNUMBER
(revision number),DATE
(revision at start of the date),HEAD
(latest in repository),BASE
(base rev of item’s working copy),COMMITTED
(last commit at or beforeBASE
),PREV
(revision just beforeCOMMITTED
)-q [--quiet]
-> Print nothing, or only summary information--ignore-externals
-> Ignore externals definitions--parents
-> Make intermediate directories-m [--message] ARG
-> Specify log messageARG
-F [--file] ARG
-> Read log message from fileARG
--force-log
-> Force validity of log message source--editor-cmd ARG
-> UseARG
as external editor--encoding ARG
-> Treat value as being in charset encodingARG
--with-revprop ARG
-> Set revision propertyARG
in new revision using the name[=value] format
svn move <From File Path> <To File Path>
This command is used to move one file or item from one place to another in a working copy or repository. This is purely equivalent to first copy the file content from one place to another and then delete the file from where copy content has been made.
Options
-r [--revision] ARG
->ARG
(some commands also takeARG1:ARG2
range), a revision argument can beNUMBER
(revision number),DATE
(revision at start of the date),HEAD
(latest in repository),BASE
(base rev of item’s working copy),COMMITTED
(last commit at or beforeBASE
),PREV
(revision just beforeCOMMITTED
)-q [--quiet]
-> Print nothing, or only summary information--force
-> Force operation to run--parents
-> Make intermediate directories-m [--message] ARG
-> Specify log messageARG
-F [--file] ARG
-> Read log message from fileARG
--force-log
-> Force validity of log message source--editor-cmd ARG
-> UseARG
as external editor--encoding ARG
-> Treat value as being in charset encodingARG
--with-revprop ARG
-> Set revision propertyARG
in new revision using the name[=value] format
svn status <File Path>
This command is used to print the status of working copy files and directories.
Options
-u [--show-updates]
-> Display update information-v [--verbose]
-> Print extra information--depth ARG
-> Limit operation by depthARG
(‘empty
’, ‘files
’, ‘immediates
’, or ‘infinity
’)-q [--quiet]
-> Don’t print unversioned items--no-ignore
-> Disregard default and svn:ignore property ignores--incremental
-> Give output suitable for concatenation--xml
-> Output in XML--ignore-externals
-> Ignore externals definitions--changelist [--cl] ARG
-> Operate only on members of changelistARG
:cool: … Really interesting ones!!! :) There are a lot of options available for each and every SVN command, and which will make a programmer’s life much easier than not using any SubVersion mechanism.
But, there are still some more commands we have, which will be helpful while dealing with one project/application. So, STAY TUNED for my next blog that will cover some more commands. Hope you will like this blog.
Thanks and I will be happy to hear from you :).