SVN Interview Questions and Answers
by Nithyanandham, on Sep 11, 2022 6:09:40 PM
Q1. What Is Svn?
Ans: Subversion is an open source control system which is used to trace all the changes made to your source code. It is a repository used to manage files, folders, directories and the modification made to these files over a period of time. While SVN repository provides a complete history of changes made to the files and can easily track if someone had made changes in the file.
Q2. What Is “branch” , “tag” And “trunk” In Svn ?
- 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.
Q3. What Is Use Of Revert In Svn?
Ans: Revert your local changes.
Q4. 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.
It have two types:
- 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.
Q5. List Out What Is The Best Practice For Svn?
- Work from your own local work-space
- Commit small autonomous changes
- Use comment
- Validate the files you are committing, you actually changed
- Take Update before commit to the Repo.
Q6. List Out What All Things Should Be Stored In Svn Repository?
- Source Code
- Mysql Queries
- Database Updates
- Project regarding important files
- Product Documents
- Minutes of Meting and Imp Email
Q7. How You Can Apply A Patch In Svn?
Ans: To apply a patch in SVN, you are required to “Create Patch” by making changes and generating the .diff file. Then this .diff file can be implemented to the new code base using “Apply Patch”.
Q8. What Is The Difference Between Git And Svn Repository?
Ans: The difference between SVN and GIT is
- Git does not support “commits” across multiple branches or tags. Subversion allows the creation of folders at any location in the repository layout.
- Gits are unchangeable while subversion enables committers to treat a tag a branch and to create multiple revisions under a tag root.
- Git is less preferred for handling large files or frequently changing binary files while SVN is capable of handling multiple projects stored in the same repository.
Q9. What Is The Difference Between Commit And Update?
Ans: Update is used to update the local workspace with the changes made by the team to the repository, while commit is the process to implement changes from local to repository, in simple words, upload a file into repository.
Q10. 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.
Q11. What Is The Command Use To View The Difference Between The Local Version And Repository Version?
Ans: he command uses to view the difference between the local and repository version is
- Svn diff filename
- Svn diff dirname
Q12. What Does The Result Codes G And R In Svn Indicates?
Ans: The result codes G and R in svn indicates:
G code: Changes on the repo were automatically merged into the working copy.
R code: This code indicates that item has been replaced in your working copy. This means the file was programmed or scheduled for deletion, and a new file with the same name was scheduled for addition in its place.
Q13. What Is The Function Of Revert In Subversion?
Ans: “Revert” function will remove your local changes and reload the latest version from the repository.
Q14. 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
Q15. List Out The Common Subversion Commands?
Ans: Common subversion commands include:
Other than these it also has command like revert, move, copy and merge.
Q16. How You Can Revert To A Previous Version?
Ans: To retrieve a previous version, you have to use “revert” command. But revert command will simply erase local edits; what you actually need is to “merge” command. For example, you have a file [abc.txt] and the current version is 101, and you want version 201. Then you will use the command like
Svn merge –r 101:201 abc.txt
Svn commit –m “Reverted to revision 201” abc.txt
Q17. What Are The Commands 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
Q18. 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
Q19. Mention How You Can Import Your Existing Directory Into The New Repository?
Ans: he 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”.
Q20. 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