Introduction to SVN Interview Questions and Answers
SVN or subversion is a software versioning and revision control system distributed as an open-source license by Apache. Version Control System helps software developers work together and maintain a complete history of their work.
A VCS is divided into two categories:
- A centralized version control system (CVCS)
- Distributed/ Decentralized Version Control System (DVCS)
Steps to work with SVN
Below are the steps:
- Create a repository: This is the central place where all the files and history of changes made to those files are stored. The create operation is used to create a new repository, mostly used only once in the initial phase of creating a repository.
- Checkout: This is the command itself. It is used to get a working copy from the repository.
- Update: This is also a command used to update the working copy. This command synchronizes the working copy with the repository.
- Perform changes: After checking out the files, many changes can be done to the files. The most common is an edit. A user can also add files/ directories or delete them.
- Review changes: After any changes done to the file and before committing the changes to the repository, SVN provides the option of reviewing the changes and updating (add/delete) them.
- Fix mistakes: Revert command is used in this step. It helps with undoing the changes made.
- Resolve conflicts: Suppose a file was added in one branch and deleted in another. In such a situation, a user needs to take the decision. Merge command automatically handles the merging of conflicts.
- Commit changes: In this step, changes are done locally in the local copy and copied in the repository, and they persist permanently until any modifications are done in the next checkout. Commit command is used to commit changes.
Setting up subversion
As Subversion is open source software, it is available freely on the internet. It also comes by default in many Linux installations and is already available on machines. To confirm if SVN is available on the current machine, use the following command
If svn is already present, this command will give a version of software installed; otherwise, it will give an error.
For RPM-based GNU/Linux systems, the yum command is used for SVN installation, while for Debian based GNU/Linux systems, the apt command is used. To create a new repository on a server, we need to install the Apache httpd module and svnadmintool.
If you are looking for a job related to SVN, you need to prepare for the 2020 SVN Interview Questions. Every interview is indeed different as per the different job profiles. Here, we have prepared the important SVN Interview Questions and Answers, which will help you succeed in your interview.
In this 2020 SVN Interview Questions article, we shall present the 10 most important and frequently asked SVN interview questions. These questions are divided into two parts are as follows:
Part 1 – SVN Interview Questions (Basic)
This first part covers basic Interview Questions and Answers.
Q1. What is SVN?
Subversion is an open-source versioning system. It keeps the repository of every change made to code files or any other files in a system. This system also manages the additions or deletions made. The use of this system is that it provides all the details of a person who made changes to the source code. Useful in projects where multiple people work on the same code base.
Q2. What is SVN used to store?
The SVN used in a store is.
- The actual code of a project
- Database queries.
- Database update.
- Other files that can be crucial in a project
- Different user documents like BRD, SRD, etc.
- MOM and other email conversations regarding that project.
Q3. What are the G and R code in SVN?
Please find below the different tables that are supported:
- G code: indicates changes made by one user and committed in the repository are automatically updated in a local working copy.
- R code: it means the item was in a queue for deletion and another item with the same name is in a queue for addition.
Q4. Can you insert a patch directly in one of the subsections without affecting the entire file?
This is the basic SVN Interview Question asked in an interview. Yes, it can have done with the help of some special methods. It is an advantage provided to users to insert their changes in minimum turnaround time. Simply create a new patch with the help of the command “filename”. diff file,” and the user is free to make use of the command “Apply Patch” for this.
Q5. Explain the terminologies “trunk”, “batch”, and “tag”.
- Trunk: it is a mainstream of development present in the SVN repository created at the start and exists till the end of a project.
- Branch: it is a copy derived from a trunk. It flows in the direction of certain changes without disturbing other users. Multiple branches can be created, each having its own path of code changes for different functionalities.
- Tag: display milestones in the repository history section, where major changes are done or points where code revision is done.
Part 2 – SVN Interview Questions (Advanced)
Let us now have a look at the advanced Interview Questions.
Q6. How does the SVN checkout command works?
It will simply create a folder on the local system for the first time and copy all the files to that location. To help the user work independently on the code.
Q7. In a subversion, what is the difference between commit command and update command?
For an updated local copy of the code, a user uses the “Update command”. This command reflects all the changes made and committed in the current document by other users in a project team. Unlikely, the commit command copies all the changes made to code by you in your local working copy to the main repository. Commit command minimizes user efforts by uploading the files into a repository through a single command.
Q8. State the differences between GIT and SVN repository?
- Using SVN, user can use “commit” for multiple branches and tags, while GIT has no such provision.
- In Subversion, new folders can be created at any node of the repository tree; in GIT, new folders are created only at the root node.
- In Subversion, every commit or tag can be converted into the branch and can be converted into multiple revisions under a single tag.
- GIT is not a popular choice for handling large files or for frequently changing binary files.
Q9. Why revert command is used in subversion?
This is the most asked SVN Interview Question in an interview. As the word suggests, this command will remove the changes made into a local working copy. The working copy will be in sync with the latest copy in the repository.
This command can be called in the following ways.
- Local Revert: it removes the changes done recently that are done after the update command is run and before those changes are committed in a repository.
- Repo Revert: it removes changes done on a repository level.
Q10. How to check the content of a repository?
In SVN, you can see the tree structure of all the directories, folders, files present under any given repository. There are subversion commands that help in this. The command path for this is
Svn list file://home/xsurface/repo/programming_repo
Once this command is executed, you will get a chance to see the exact structure of a repository.
This has been a guide to the list Of SVN Interview Questions and Answers so that the candidate can crackdown these Interview Questions easily. Here in this post, we have studied top SVN Interview Questions, which are often asked in interviews. You may also look at the following articles to learn more –