Subversion SVN Interview Questions and Answers

Subversion SVN Interview Questions and Answers

Last updated on 14th Oct 2020, Blog, Interview Question

About author

Giridharan (Sr SVN Administrator )

He is Highly Experienced in Respective Technical Domain with 6+ Years, Also He is a Respective Technical Trainer for Past 5 Years & Share's This Important Articles For us.

(5.0) | 16142 Ratings 1879

Subversion is a version control system that keeps track of changes made to files and folders (directories), facilitating data recovery and providing a history of the changes that have been made over time. Subversion was designed to replace Concurrent Versions System (CVS), an established program for saving and retrieving multiple versions of source code.

1.What Exactly Is Svn?

Ans:


Open source version control system (VCS) which is in the short referred to as SVN, specifically designed for tracing all the modifications that have taken place to the source code of your design or files. SVN is a source which is utilised to direct all the files and folders and all the recent modifications which have happened in these files. SVN helps us to keep a complete track of the changes done by any person or by yourself onto the files.

2.List Out What All Things Should Be Stored In Svn Repository?

Ans:

  • Source Code
  • Mysql Queries
  • Database Updates
  • Project regarding important files
  • Product Documents
  • Minutes of Meting and Imp Email

3.Difference Between Svn Commit And Svn Update?

Ans:


SVN commit: Push (upload) the local changes to Repository.
SVN Update: Get (download) the Repository changes files to local system.

4.What Is Use Of Revert In Svn?

Ans:

Revert your local changes.
It have two type:

  • Local Revert: It will delete all changes from files which you made after updates and before commit.
  • Repo Revert: Upload the changes to previous Repo.

5.List Out All The Command Prompts Used In The Svn?

Ans:


SVN has a quite long list of commands prompt out of which few are considered to be most effective and are regularly used in performing different operations in this system.
Some of the most commonly used common prompts in SVN are:

  • Revert
  • Import
  • Checkout
  • Commit
  • Update
  • Copy
  • Beside these command prompts SVN has also the presence of other set of commands which are handy for different set of operations.

6.How To Delete File From Svn Repo?

Ans:

  • svn delete filename

7.What Is The Use Of Tortoisesvn?

Ans:


TortoiseSVN is a Subversion client, implemented as a Microsoft Windows shell extension, that helps programmers manage different versions of the source code for their programs. It is a free software released under the GNU General Public License.

8.How To List The Entire Cos By A User In Different Jobs Through A Single Command?

Ans:

  • ct lsco -me
  • this gives all checked out files by a user
  • ct lsco -avobs -cview -me
  • List all files checked out to all views by a user

9.Describe About Different Best Practices For Svn?

Ans:


Some of the best practical approaches which are the best fit for SVN if effectively followed include:

  • The very first thing to be taken care of while working with the SVN is that make use of your own local space in order to perform any function in the SVN.
  • Secondly while working on SVN platform it is highly advisable to commit to all the autonomous changes no matter how small the changes may be. 
  • Making use of the comment option will be of a great help for the team to know what are the changes are done and why by just going through the comment section. 
  • The best approach in SVN is to validate all the set of files you are committing, you actually changed and it is always advisable to keep a copy of the update whenever you proceed to commit to the report.

10.Tell Us About All The Elements That Should Be Stored In The Svn Repository?

Ans:


SVN repository can be used for storing all the existing changes and files which are present in the branches of the existing system.
Here below is the list of all the things which are stored in the SVN repository:

  • MySQL Queries
  • Project regarding important files
  • Product Documents
  • Database Updates
  • Minutes of Meting and Imp Email
  • Source Code
Subscribe For Free Demo

Error: Contact form not found.

11.Explain About The Concept Of Synchronizing With The Repository & Tell Us About The Disparity Between Synchronizing And Update?

Ans:


The term synchronizing with the repository simply relates to the procedure of updating your local workspace with all the changes which have been committed by the other members of your team.
This is totally different from the concept of Update as Merge is a function that can be performed manually for the merge conflicts by simply using this.

12.What Is The Command To Create A New Directory Under Version Control?

Ans:


Command to create a new directory under version control includes
Svn mkdir directory
Svn mkdir http://url/directory

13.Mention How You Can Import Your Existing Directory Into The New Repository?

Ans:


The command you will use to import your existing directory into the new repository you have to write
Svn import/home/my surface/programming 

  • file:///home/mysurface/repo/programing_repo-m “initial import”.

14.State The Procedure Of Creating A Patch Is Svn?

Ans:


For the purpose of applying a patch in SVN the first thing you are required to do is to “Create Patch” by stimulating changes and creating the .dff file. Then, this existing .diff file can be implemented to the latest code base by using “Apply Patch”.

15.Differentiate Between The Git & Svn Repository?

Ans:


The major differentiating aspects of GIT & SVN concepts are:

  • The command “commit” is not supported by GIT across multiple branches or tags & whereas SVN facilitates the creation of new folders t any location of your repository. 
  • GIT is considered to be unvarying where as SVN supports the function of multiple revisions.
  • In the case where your presented with larger files and frequently varying binary files, the GIT is less preferred & where as SVN is best preferred for handling a number of projects which are stored in the same repository.

16.Differentiate The Concepts Of Commit And Update?

Ans:


In SVN repository the word update relates to the process of updating the local workspace in relation to all the changes which are done within the repository by the members of the team.
While the word commit relates to the simple process of making changes within the local to repository. In much easier terminology it can stated as uploading a file into the repository.

17.What Can You Say Regarding The G & R Result Codes In Svn?

Ans:


The SVN result codes are:

G Code:

G Code indicates all the changes which are that are consolidated into working copy of the report automatically.

R Code:

R Code specifies that particular context or item which is replaced in the present working directory copy. It indicates that a particular file has underwent some changes are is arranged for deleting and some other new file is scheduled to get added in its area.

18.State The Process Involved To Revert To A Previous Version?

Ans:


For the purpose of retrieving the previously existing version, the main command on which you are needed to focus is the “revert” command. The action performed by the revert command is that it simply erase all the local edits. But the main command which is needed to be used for this operation is the “merge” command. 

This can be explained with a simple example.  For instance, the present version of your file [xyz.txt] is version 201 and the version which you currently require is 301.
In such an instance the command code should be executed in this manner

  • svn merge –r 201:301 xyz.txt
  • svn commit –m “Reverted to revision 301” xyz.txt

19.What Do You Mean By “synchronizing With Repository” ? How Is It Different From “update”?

Ans:


Synchronizing with Repository is the process of updating the local workspace with the changes committed by others. This is different from Update as we can do Merge Manually for the Merge conflicts using this.

20.What Is The Best Practice For Svn?

Ans:


Best practices for SVN:

  • Update and Test before commit
  • Work from your own local workspace
  • Commit small autonomous changes
  • Validate the files you are committing, you actually changed
  • Keep in touch with repository
  • Watch for conflicts
  • Always group your check-in logically
  • Use comment

21.What Is “branch” , “tag” And “trunk” In Svn ?

Ans:

Trunk is the main body of development, originating from the start of the project till end.

Branch is a copy of code derived from a certain point in the trunk that is used for applying major changes to the code while preserving the integrity of the code in the trunk.

Trunk is a point in time on the trunk or a branch that you wish to preserve. This is like base lining the code after a major release.

22.How to add SVN file?

Ans:

  • svn add filename.php

23.How to add SVN folder?

Ans:

  • svn add foldername

24.How to get Updates from SVN Repo?

Ans:

  • svn update
Course Curriculum

Get Subversion SVN Training with Industry Oriented Topics From Real-Time Experts

  • Instructor-led Sessions
  • Real-life Case Studies
  • Assignments
Explore Curriculum

25.How to get SVN Info?

Ans:

  • svn info

26.How to get SVN Log for a file?

Ans:

  • svn log testFile.php

27.How to check for modifications?

Ans:

  • svn status -v PATH

28.How to apply a patch in SVN ?

Ans:

First we need to “Create Patch” by making changes and generating the .diff file. Then this .diff file can be applied to the new Code base using “Apply Patch”.

29.What are the command that can be used to move some subset of code and history of this code from one SVN repo to another?

Ans:

Following commands can be used

  • svnadmin dump
  • svndumpfilter include
  • svnadmin load
  • svn remove

30.what is the function of Revert in subversion?

Ans:

“Revert” function will remove your local changes and reload the latest version from the repository.

31.what is the command to see what is inside the repository?

Ans:

Command svn list file:///home/mysurface/repo/programming_repo is used to see what is inside the repository.

32.what is the command use to view the difference between the local version and repository version?

Ans:

The command uses to view the difference between the local and repository version is

  • svn diff filename
  • svn diff dirname

33.Mention what is the command to add a file or dir?

Ans:

To add a file or dir in SVN the command you will use

  • svn add filename
  • svn add dirname

34.What is Version Control System?

Ans:

It is a software that helps software developers to work together and maintain a complete history of their work.

35.What are the different goals of Version Control System?

Ans:

Following are the goals of VCS:

  • It allow developers to work simultaneously.
  • Do not overwrite each other’s changes.
  • Maintain history of every version of everything.

36.What are the different categories of VCS?

Ans:

Following are the different categories of VCS:

  • Centralized Version Control System (CVCS)
  • Distributed/Decentralized Version Control System (DVCS).

Centralized Version Control System – works on client-server model. There is a single master copy of the code base so the developer who has to work on part of that code need to lock it and take the check out.

Distributed Version Control System – these system works on peer-to-peer model. There is still a master copy of the code base, but it is on a client machine rather than a server. There is no locking of parts of the code; developers make changes in their local copy and then, once they are ready to integrate their changes into the master copy, they issue a request to the owner of the master copy to merge their changes into the master copy.

37.What is the repository in version control system?

Ans:

It is the central place where developers store all their work. Repository not only stores files but also the history. Repository is accessed over a network, acting as a server and version control tool acting as a client.

38.What is the trunk in version control system?

Ans:

The trunk is a directory where all the main development happens and is usually checked out by developers to work on the project.

39.What are the tags in version control system?

Ans:

The tags directory is used to store named snapshots of the project. Tag operation allows to give descriptive and memorable names to specific version in the repository.

40.What are the branches in version control system?

Ans:

Branch operation is used to create another line of development. It is useful when you want your development process to fork off into two different directions.

Subversion-Svn Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download

41.What is the life cycle of Version Control System?

Ans:

Here is the life cycle of Version Control System:

  • Create Repository
  • Checkout
  • Update
  • Perform Changes
  • Review Changes
  • Fix Mistakes
  • Resolve Conflicts
  • Commit Changes

42.What is create repository in VCS?

Ans:

The ‘create’ operation is used to create a new repository. Most of the times this operation is done only once.

43.What is a distributed VCS?

Ans:

  • These are the systems that don’t rely on a central server to store a project file and all its versions.
  • In Distributed VCS, every contributor can get a local copy or “clone” of the main repository.
  • As you can see in the above diagram, every programmer can maintain a local repository which is actually the copy or clone of the central repository which is present on their hard drive. They can commit and update their local repository without any hassles.
  • With an operation called “pull”, they can update their local repositories with new data from the central server and “pull” operation affects changes to the main repository from their local repository.

44.What is SubGit?

Ans:

SubGit is a tool for SVN to Git migration. It can create a writable Git mirror of a local or remote Subversion repository and use both Subversion and Git as long as you like.

Now you can also include some advantages like you can do a fast one-time import from Subversion to Git or use SubGit within Atlassian Bitbucket Server. We can use SubGit to create a bi-directional Git-SVN mirror of an existing Subversion repository. You can push to Git or commit to Subversion as per your convenience. Synchronization will be done by SubGit. 

45.Basic use of Subversion

Ans:

Here are some examples of common operations that are performed with a Subversion (SVN) repository. They are shown here using the SVN command-line client but the same operations apply to any SVN client.

The examples show the typical development process using Subversion (SVN):

    1. 1.Import existing code into the SVN repository
    2. 2.Standard work cycle of development and testing
    3. 3.Commit the finished code to the SVN repository

The examples on this page refer to a source code file prog.c in the repository repo1 of the BigProject project, being accessed by a user with the username nye.

46.Importing Code

Ans:

Import files into the repository with the svn import command:

  • svn –username nye import prog.c -m “Initial import” https://svn.rcs.le.ac.uk/BigProject/repo1/prog.c
  • Authentication realm: <https://svn.rcs.le.ac.uk:443> RCS SVN Repository
  • Password for ‘nye’: ********
  • Adding     prog.c

Committed revision 1.

Use the -m option to add a comment explaining why the change was made. Whenever changes are made to the contents of the repository, SVN will expect a comment to be added for the audit log.

At this point the program source file is in the repository and has a revision number 1. It would be accessible as https://svn.rcs.le.ac.uk/BigProject/repo1/prog.c

Subversion SVN Sample Resumes! Download & Edit, Get Noticed by Top Employers!DOWNLOAD

47.Work Cycle?

Ans:

Once you have imported some code into the repository, you would typically follow this work cycle of development and testing:

    1. 1.Checkout a working copy of the code
    2. 2.Make changes to the code
    3. 3.Resolve conflicts
    4. 4.Commit the updated code to the SVN repository

48.Checkout the working copy

Ans:

Use the svn co command to check out the latest version of the code to the local file system. You can only check out directories, not individual files. Therefore in this example the top level of the repository must be checked out.

  • svn –username nye co https://svn.rcs.le.ac.uk/BigProject/repo1
  • svn co https://svn.rcs.le.ac.uk/BigProject/repo1
  • Authentication realm: <https://svn.rcs.le.ac.uk:443> RCS SVN Repository
  • Password for ‘nye’: ********
  • A   repo1/prog.c

Checked out revision 1.

This creates a new directory repo1 containing a working copy of the prog.c file.

49.Make changes?

Ans:

Once you have checked out the code, you can make changes and compile and test the code as normal.

SVN allows collaborators to work on the same files concurrently, so before committing the updated file to the repository it is a good idea to check whether there are any conflicts between your changes and any changes that may have been made by someone else.

50.Resolve conflicts?

Ans:

Run the svn update command. This will attempt to bring your working copy up to date with the latest version in the repository. If there are any conflicts they will be flagged for further action before the working copy can be updated.

In the example below a conflict has occurred between the working copy and the copy in the repository.

  • svn –username nye update prog.c
  • Authentication realm: <https://svn.rcs.le.ac.uk:443> RCS SVN Repository
  • Password for ‘nye’: ********
  • Conflict discovered in ‘prog.c’.

Select:

  • (p) postpone, (df) diff-full, (e) edit,
  • (mc) mine-conflict, (tc) theirs-conflict,
  • (s) show all options:

How to proceed at this point depends on the nature of the conflict. See the Resolving Conflicts section in Version Control with Subversion for more information.

Are you looking training with Right Jobs?

Contact Us

Popular Courses