Version Control with Subversion: Tortoise SVN – II

Hello everyone, 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 <subcommand> to get individual brief details for that 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
1. -r [--revision] ARG -> ARG (some commands also take ARG1:ARG2 range), a revision argument can be NUMBER(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 before BASE), PREV(revision just before COMMITTED)
2. -v [--verbose] -> Print extra information
3. -R [--recursive] -> Descend recursively, same as –depth=infinity
4. --depth ARG -> Limit operation by depth ARG (’empty’, ‘files’, ‘immediates’, or ‘infinity’)
5. --incremental -> Give output suitable for concatenation
6. --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
1. -r [--revision] ARG -> ARG (some commands also take ARG1:ARG2 range), a revision argument can be NUMBER(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 before BASE), PREV(revision just before COMMITTED)
2. -q [--quiet] -> Print nothing, or only summary information
3. --depth ARG -> Limit operation by depth ARG (’empty’, ‘files’, ‘immediates’, or ‘infinity’)
4. --force -> Force operation to run
5. --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
1. -r [--revision] ARG -> ARG (some commands also take ARG1:ARG2 range), a revision argument can be one of NUMBER(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 before BASE), PREV(revision just before COMMITTED).
2. --depth ARG -> Limit operation by depth ARG (’empty’, ‘files’, ‘immediates’, or ‘infinity’)
3. --set-depth ARG -> set new working copy depth to ARG (‘exclude’, ’empty’, ‘files’, ‘immediates’, or ‘infinity’)
4. -q [--quiet] -> Print nothing, or only summary information
5. --diff3-cmd ARG -> Use ARG as merge command
6. --force -> Force operation to run
7. --ignore-externals -> Ignore externals definitions
8. --changelist [--cl] ARG -> Operate only on members of changelist ARG
9. --editor-cmd ARG -> Use ARG as external editor
10. --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)’)
11. --parents -> Make intermediate directories

svn add <File Name>

This command will help to add files or directories, subdirectories or symlinks to repositories.

Options
1. --targets ARG -> Pass contents of file ARG as additional args
2. --depth ARG -> Limit operation by depth ARG (’empty’, ‘files’, ‘immediates’, or ‘infinity’)
3. -q [--quiet] -> Print nothing, or only summary information
4. --force -> Force operation to run
5. --no-ignore -> Disregard default and svn:ignore property ignores
6. --auto-props -> Enable automatic properties
7. --no-auto-props -> Disable automatic properties
8. --parents -> Add intermediate parents

svn delete <File Name>

This will help user to delete an item from working copy or working repository.

Options
1. --force -> Force operation to run
2. -q [--quiet] -> Print nothing, or only summary information
3. --targets ARG -> Pass contents of file ARG as additional args
4. -m [--message] ARG -> Specify log message ARG
5. -F [--file] ARG -> Read log message from file ARG
6. --force-log -> Force validity of log message source
7. --editor-cmd ARG -> Use ARG as external editor
8. --encoding ARG -> Treat value as being in charset encoding ARG
9. --with-revprop ARG -> Set revision property ARG in new revision using the name[=value] format
10. --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 to paths as argument, one is from file path and another is to file path.

Options
1. -r [--revision] ARG -> ARG (some commands also take ARG1:ARG2 range), a revision argument can be NUMBER(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 before BASE), PREV(revision just before COMMITTED)
2. -q [--quiet] -> Print nothing, or only summary information
3. --ignore-externals -> Ignore externals definitions
4. --parents -> Make intermediate directories
5. -m [--message] ARG -> Specify log message ARG
6. -F [--file] ARG -> Read log message from file ARG
7. --force-log -> Force validity of log message source
8. --editor-cmd ARG -> Use ARG as external editor
9. --encoding ARG -> Treat value as being in charset encoding ARG
10. --with-revprop ARG -> Set revision property ARG 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
1. -r [--revision] ARG -> ARG (some commands also take ARG1:ARG2 range), a revision argument can be NUMBER(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 before BASE), PREV(revision just before COMMITTED)
2. -q [--quiet] -> Print nothing, or only summary information
3. --force -> Force operation to run
4. --parents -> Make intermediate directories
5. -m [--message] ARG -> Specify log message ARG
6. -F [--file] ARG -> Read log message from file ARG
7. --force-log -> Force validity of log message source
8. --editor-cmd ARG -> Use ARG as external editor
9. --encoding ARG -> Treat value as being in charset encoding ARG
10. --with-revprop ARG -> Set revision property ARG 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
1. -u [--show-updates] -> Display update information
2. -v [--verbose] -> Print extra information
3. --depth ARG -> Limit operation by depth ARG (’empty’, ‘files’, ‘immediates’, or ‘infinity’)
4. -q [--quiet] -> Don’t print unversioned items
5. --no-ignore -> Disregard default and svn:ignore property ignores
6. --incremental -> Give output suitable for concatenation
7. --xml -> Output in XML
8. --ignore-externals -> Ignore externals definitions
9. --changelist [--cl] ARG -> Operate only on members of changelist ARG

😎 … Really interesting ones!!! 🙂 There are a lot of options available for each and every SVN commands, 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 will be happy to listen from you 🙂 :).