Centralized Version Control With Apache Subversion And Its Benefits
Application Development
Gowri Sundari June 15, 2020

An Introduction to SVN

SVN is a sub-version of Version Control System (VCS), which is often classified as a free-source or an open-source control system. This indicates that subversion controls directories and files moreover even the modifications made to them as well. This allows a developer to recover earlier versions of information or assess the records of how a particular data was altered. SVN (Subversion) is also regarded as a Centralized Version Control System, that is different from distributed Version Control like “GIT”.

What Does Centralized Version Control Mean?

A centralized version control system works on a client-server model where the version history is stored in the central server. As the name indicates, a centralized version control system (VCS) updates the history of modifications on a “Central Server” from which developers can request for the latest version of the work and update their latest changes into it. This strategy suggests that every developer sharing the server also shares their work with each other.

How Does SVN Work?

An SVN setup has 2 main elements :

  • The “Server”, which has all the version of all the files in the project
  • A “local copy of the files” which is on your computer

SVN Workflow

Advantages of SVN

  • Manage files between multiple users
  • SVN can be faster
  • Easier to merge
  • History can be analyzed

SVN Commands in Linux :

1. SVN checkout/co :

This command is used to pull an SVN tree from the server.

Syntax: svn checkout/co URL path

2. SVN add :

When we are creating a new file or directory, it needs to tell the SVN server about it. It doesn’t show in the SVN repository until and unless we perform an SVN commit.

Syntax: Svn add filename

Ex: svn add “testfile”

3. SVN delete :

The file will be deleted from the local sandbox immediately as well as from the repository after committing.

EX: svn delete “sample.txt”

Delete the file from the local.

4. SVN commit/ci :

This command recursively sends your changes to the SVN server. It will commit changed files, added files and delete files

It lets you commit a simple modification to a file with the commit message on the command line.

Ex:
svn commit -m “added testfile”

Output: sending a

Transmitting file data

Committed revision 3

Ex: svn commit -m “remove the file sample.txt”

Deleting sample.txt

Committed revision 4

5. SVN list :

SVN list is used to view the content of the SVN repository without downloading the files.

Syntax: svn list

It displays the following information :

  • The revision number of the last commit
  • Author of the last commit
  • Size (in bytes)
  • Date and time of the last commit

6. SVN Diff :

SVN diff displays the difference between your working copy and the original copy in the SVN repository

Syntax: svn diff filename

7. SVN status :

This code lets you get the status of the working file in the executing copy. It displays whether the working copy file is modified or added/deleted, or the file is not under revision control, etc.

8. SVN log :

SVN identifies every change made to your files & directories. Therefore, the SVN log is used to know all the commits made in a file or directory.

Syntax: svn log path

9. SVN move :

It moves a file from one directory to another directory or renames a file.

Syntax:

Svn move source destination

10. SVN update :

SVN update command brings the changes from the repository into your working directory.

Therefore, it’s better to update the working copy before commencing to operate on the working directory.

Syntax:

svn update path

During SVN update conflicts are required to be resolved manually, as merging is an issue with SVN.

If your project is sufficiently complex, you’ll discover that it’s sometimes better to implement the SVN repository, as it is shared, there is no extra set-up required and therefore makes collaboration easier.

For a free consultation on IoT, Enterprise or Telecom Service, contact us at sales@thinkpalmtest.thinkpalm.info


Author Bio

Gowri Sundari is working at ThinkPalm as a Senior Software Engineer. She is passionate about Perl & Python programming.