20 Must Know SVN Interview Questions

Brief of SVN

Before we go into SVN Interview Questions let’s see what is svn. Subversion, or SVN, is a centralized source control system. Whereas developers in Git can work in a very decentralized manner, with an offline copy of their code, a connection is required to work with SVN repositories. Branching works a little differently, by basing new code of the so-called trunk and merging them back. The trunk is the main code repository like the master branch is in Git. While Git does not version revisions, SVN does.

Basic svn questions

  • Difference between GIT and SVN repository?
  • What is the difference between “svn export”, “svn checkout” ?
  • What is the difference between “svn update and “svn commit” ?
  • How can u resolve conflict in SVN? Interviewer may also ask you to explain one scenario how you resolved conflicts in SVN in your current project. 
  • What is the command to see what is inside the svn repository?
  • What all things we can store in SVN repository?
  • Difference between “svn import”, “svn add” and “svn commit” ?
  • How can you revert to previous version in SVN?
  • Best practices of SVN
  • How can see the difference between the local version and repository version of files in SVN?

Svn questions command related

  • How do you create a release branch?

​ ​prompt>​​ ​​svn​​ ​​copy​​ ​​-m​​ ​​”Create 1.0 release branch”​​ ​​\​
​ ​ ​​http://svn.mycompany.com/mbench/trunk​​ ​​\​
​ ​ ​​http://svn.mycompany.com/mbench/branches/RB_1.0

  • How do you Switch to a branch?

​ ​prompt>​​ ​​cd​​ ​​work/mbench​
​ ​mbench>​​ ​​svn​​ ​​switch​​ ​​http://svn.mycompany.com/mbench/branches/RB_1.0

  • How do you Create a release tag from a working copy?

​ ​prompt>​​ ​​cd​​ ​​work/mbench-1.0​
​ ​mbench-1.0>​​ ​​svn​​ ​​update​
​ ​mbench-1.0>​​ ​​svn​​ ​​copy​​ ​​.​​ ​​\​
​ ​ ​​http://svn.mycompany.com/mbench/tags/REL_1.0.0​​ ​​\​
​ ​ ​​-m​​ ​​”Create R1.0.0 tag”

  • How do you Mark a file that needs locking?

​ ​mbench>​​ ​​svn​​ ​​propset​​ ​​svn:needs-lock​​ ​​yes​​ ​​docs/benchmarks.xlsx​
​ ​mbench>​​ ​​svn​​ ​​commit​​ ​​-m​​ ​​”Spreadsheet requires a lock before editing”

  • How do you Lock a file for editing?

​ ​docs>​​ ​​svn​​ ​​update​
​ ​docs>​​ ​​svn​​ ​​lock​​ ​​benchmarks.xlsx​​ ​​-m​​ ​​”Adding 64-bit results”​
​ ‘benchmarks.xlsx’ locked by user ‘mike’

  • How do you Convert your CVS repository to a Subversion dump file?

prompt>​​ ​​cd​​ ​​/tmp/cvs-convert​
​​cvs-convert>​​ ​​cvs2svn​​ ​​–dumpfile=some-project.dump​
–encoding=UTF8 –encoding=latin1 some-project/

  • How do you Remove a property from a file?

​ ​mbench>​​ ​​svn​​ ​​propdel​​ ​​reviewed-by​​ ​​src/mbench.java​
​ property ‘reviewed-by’ deleted from ‘src/mbench.java’.

  • How do you Import third-party source code?

Extract the third-party source code to a temporary directory. Here we use /temp/NUnit-2.5.0.

​ ​temp>​​ ​​svn​​ ​​import​​ ​​-m​​ ​​”Import NUnit 2.5.0″​​ ​​NUnit-2.5.0​​ ​​\​
​ ​ ​​http://svn.mycompany.com/vendorsrc/nunit/current​
​ Adding NUnit-2.5.0/NUnitTests.config
​ Adding NUnit-2.5.0/NUnitFitTests.html
​ : : :
​ Adding NUnit-2.5.0/install/NUnit.wxs
​ Adding NUnit-2.5.0/license.rtf

  • How do you see which files have changed in your working copy?

​ ​mbench>​​ ​​svn​​ ​​status

  • How do you revert a revision using the command-line client?

​ ​mbench>​​ ​​svn​​ ​​merge​​ ​​-r​​ ​​14:13​​ ​​.​
​ — Reverse-merging r14 into ‘.’:
​ G .idea/workspace.xml
​ U src/mbench.java
​ ​prompt>​​ ​​svn​​ ​​commit​​ ​​-m​​ ​​”Reverted revision 14″

FAQs: SVN Interview Questions

How do you Check out into a local working copy?

use command to Check out into a local working copy.
​  ​prompt>​​ ​​cd​​ ​​~/work​
​  ​prompt>​​ ​​svn​​ ​​checkout​​ ​​http://svn.mycompany.com/mbench/trunk​​ ​​mbench

How do you Create a base directory for the repository ?

Create a base directory for the repository, and then initialize it.​ 
​prompt>​​ ​​mkdir​​ ​​-p​​ ​​~/svn/repos​
​ 
​prompt>​​ ​​svnadmin​​ ​​create​​ ​​~/svn/repos

How do you show log entries for your working copy?​ 

Show log entries for your working copy.​ 
​prompt>​​ ​​cd​​ ​​~/work/myproject​
​ 
​prompt>​​ ​​svn​​ ​​log​​ ​​|​​ ​​less

What is the difference between SVN and GIT ?

The difference between SVN and GIT is

SVN over more preferred over Git for handling large files or regularly chaning binary files while SVN is capable of handling multiple projects in the same repository

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

More Interview Topics

Comprehensive Subversion

$16.00 $19.99 in stock
Udemy udemy.com
Last update was on: April 2, 2022 7:09 am

A secure, efficient, productive way to manage your programming examples and software projects.

We will be happy to hear your thoughts

      Leave a reply

      Cloud Technologies Blog
      Logo
      Enable registration in settings - general
      Compare items
      • Total (0)
      Compare
      0
      Shopping cart