Real Time Apache Subversion Interview Questions and Answers PDF
• Explain What Is Svn?
SVN or Subversion is an open source control system; it is used to trace all the changes made to your source code or files. 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.
• Mention What Is The Difference Between Git And Svn Repository?
The difference between SVN and GIT is
o Git does not support “commits” across multiple branches or tags. Subversion allows the creation of folders at any location in the repository layout
o Gits are unchangeable while subversion enables committers to treat a tag a branch and to create multiple revisions under a tag root
o 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
• List Out What All Things Should Be Stored In Svn Repository?
In SVN repository you can store
o Source Code
o Build scripts
o Test data used by QA
o DB schema
o Project settings (When whole team is using the same IDE)
o Project documentation (Internal and External)
o Minutes of meetings, significant e-mails and info from the web
o Expensively generated artifacts
o And other documents related to the project
• Mention What Is The Command To Add A File Or Dir?
To add a file or dir in SVN the command you will use
o svn add filename
o svn add dirname
• List Out The Common Subversion Commands?
Common subversion commands include
o Import
o Checkout
o Commit
o Update
Other than these it also has command like revert, move, copy and merge.
• Explain What Is The Difference Between Commit And Update?
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.
• Explain How You Can Apply A Patch In Svn?
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”.
• Mention What Is The Command To Create A New Directory Under Version Control?
Command to create a new directory under version control includes
o svn mkdir directory
o svn mkdir http://url/directory
• Mention How You Can Import Your Existing Directory Into The New Repository?
The command you will use to import your existing directory into the new repository you have to write
svn import/home/mysurface/programming file:///home/mysurface/repo/programing_repo-m “initial import”
• Mention What Is The Command To See What Is Inside The Repository?
Command svn list file:///home/mysurface/repo/programming_repo is used to see what is inside the repository.
• Mention What Is The Command Use To View The Difference Between The Local Version And Repository Version?
The command uses to view the difference between the local and repository version is
o svn diff filename
o svn diff dirname
• Mention What Does The Result Codes G And R In Svn Indicates?
The result codes G and R in svn indicates
o G code: Changes on the repo were automatically merged into the working copy
o 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
• Mention What Is The Function Of Revert In Subversion?
“Revert” function will remove your local changes and reload the latest version from the repository.
• Explain How You Can Revert To A Previous Version?
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
o svn merge –r 101:201 abc.txt
o svn commit –m “Reverted to revision 201” abc.txt
• Mention 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?
Following commands can be used
o svnadmin dump
o svndumpfilter include
o svnadmin load
o svn remove
• List Out What Is The Best Practices For Svn?
Best practices for SVN is
o Update and Test before commit
o Work from your own local workspace
o Commit small autonomous changes
o Validate the files you are committing, you actually changed
o Keep in touch with repository
o Watch for conflicts
o Always group your check-in logically
o Use comment
• Explain What Checkout Command Is And How To Use The Checkout Command In Svn?
Check-Out command in SVN is used to create a local workable copy of your project retrieved from the local repository.
• What Is "branch" , "tag" And "trunk" In Svn ?
o Trunk is the main body of development, originating from the start of the project till end.
o 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.
o Trunk is a point in time on the trunk or a branch that you wish to preserve. This is like baselining the code after a major release.
• What Do You Mean By "synchronizing With Repository" ? How Is It Different From "update" ?
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.
• Difference Between Update And Commit ?
Update is used to update the local workspace with the changes commited by the team to the repository whereas Commit is the process to push changes from local to repository.
• How To Apply A Patch In Svn ?
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".
• What If Svn Update Gives Merge Conflicts And You Just Want Your Local Files To Be Overriden With The Repository Versions ?
We can use "Update to Revision".
• How To Add Svn File?
svn add filename.php
• How To Add Svn Folder?
svn add foldername
• How To Get Updates From Svn Repo?
svn update
• How To Delete File From Svn Repo?
svn delete filename
• How To Get Svn Info?
svn info
• How To Get Svn Log For A File?
svn log testFile.php
• How To Check For Modifications?
svn status -v PATH
• Difference Between Svn Commit And Svn Update?
SVN commit:: Push (upload) the local changes to Repository.
SVN Update:: Get (download) the Repository changes files to local system.
No comments:
Post a Comment