TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

SVN Commands

SVN Commands with What is SVN, SVN vs Git, SVN Installation, SVN Repository, Tortoise SVN, Version control System, Import a Project by Tortoise SVN, Visual SVN user Access Permission etc.

<< Back to SVN

SVN Commands

The SVN (Subversion) is used to manage the current and previous versions of data like source code, documentation, and files. It acts as the time machine for the developers and allows them to go back and browse the history of the project.

SVN operations can be performed through the command line as well as SVN clients also. Most people love the command line option. So let's understand the essential SVN commands.

Before running the SVN commands, we must have an idea about what is working copy. Let's understand it.

SVN Working Copy

A working copy is a copy that has been checked out to the staging area.

SVN is a version control system that holds all our project versions (Versioned data). It is also called an SVN server. SVN client tools manage the local reflection of the working copy. SVN client is used for accessing its repository across networks. Multiple users can access the same repository at the same time.

Here we are going to list the most used SVN commands that every developer should know.

Most used SVN commands

Some most useful SVN commands are as follows:

  • SVN Checkout Command
  • SVN Add Command
  • SVN Delete Command
  • SVN Commit Command
  • SVN Diff Command
  • SVN Status Command
  • SVN Log Command
  • SVN Move Command
  • SVN Rename Command
  • SVN List Command
  • SVN Update Command
  • SVN Info Command
  • SVN Merge Command

Let's understand these commands in detail.

SVN Checkout Command

The svn checkout command is used to create the working copy of the SVN project. The checkout operation is needed to be performed once after each change occurs in the directory structure. If the directory structure is changed, we may need to re-check out it. This command will be executed as follows:

svn checkout URL Path

Or

svn co URL Path

The URL path is the path for the files and repositories. If the PATH is omitted, the default name of the URL will be used as the destination. If multiple URLs are given, each will be checked in the subdirectory of PATH. In these paths, the name of the subdirectory is the base of the URL.

SVN Add Command

The svn add command is used to add the files in the repository for the SVN. Whenever we create a new file in our working copy, we have to send it to the SVN server. This command will be executed as follows:

svn add 

Remember, this file will be visible after an SVN commit.

SVN Delete Command

The svn delete command is used to remove the files from the repository. When we perform a delete operation, it removes the file from the working. To delete it from the repository, run a commit command after the delete command.

The svn delete command will be executed as follows:

svn delete 

To remove it from the repository, run the commit command as follows:

svn, commit -m "Removing a file."

SVN Commit Command

The svn command is used to save the changes made on the repository. Whenever we made changes on our working copy and want to reflect it on the SVN server. In such a case, we have to make a commit operation.

The commit command will be executed as follows:

svn commit -m "Commit message."

The commit message is a message for the audience that we are making changes on the project.

SVN Diff Command

The svn diff command is used to display the differences between two versions of files. We can find the differences between the working copy and the remote (SVN) copy. We can also find the two revisions, paths, and more.

The diff command will be executed as follows:

svn diff filename

svn diff -r R1: R2 filename

SVN Status Comman

The svn status command displays the status of the working copy. It shows the status whether the repository is updated, added/deleted, or file is not under revision control and more.

This command will be executed as follows:

svn status path

SVN Log Command

SVN stores all the history of the project. The svn log command is used to display all the commits made on the repository or file.

The svn log command is executed as follows:

svn log Path

SVN Move Command

The svn move command is used to move the files from the working directory. However, these files can be sent to the SVN server by commit operation.

To move the file, run the below command:

svn move src dest 

The above command will move the file to the targeted destination. Commit the file to make the changes on the repository.

SVN Rename Command

The svn rename command is used to rename the files. This command will be executed as follows:

svn rename CURR_PATH NEW_PATH

SVN List Command

The svn list command is used to display the content of the repository. It is useful in the case; you want to view the details of the repository without making a working copy.

svn list

The above command will display the files of the repository without downloading it.

The svn list command with the verbose option will provide more description of files. It will display the revision number of the last commit, Author, size, date, and time of the last commit.

SVN Update Command

The update command is used to update the working copy of the project. It brings the changes from the working copy to the repository. It matches the working copy with the HEAD by default.

It is also used in the case when changes are made by the other users; we have to update the repository.

The update command will be executed as follows:

svn update Path

SVN Info Command:

The svn info command provides a quick look at the working copy. It is accessible in the local working copy, and it does not communicate with the SVN server.

The info command will be executed as follows:

svn info

The above command will provide useful information about the repository.

SVN Merge Command

It is used to apply two differences between two sources to a working path.

svn merge SOURCE1[@N] SOURCE2[@M] [TARGET_PATH]

The above command will merge the changes to the same destination.






Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf