Subversion is a free/open source version control system (VCS). That is, Subversion manages files and directories, and the changes made to them, over time. This allows you to recover older versions of your data or examine the history of how your data changed. In this regard, many people think of a version control system as a sort of “time machine.”
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 Meeting 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 the local system.
4) What Is Use Of Revert In Svn?
Ans:
Revert your local changes.It has two types:
- Local Revert: It will delete all changes from files that you made after updates and before the commit.
- Repo Revert: Upload the changes to the 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
- Besides these command prompts, SVN has also the presence of another set of commands which are handy for different sets 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 also -me
- this gives all checked-out files by a user
- ct also -avoid -view -me
- List all files checked out to all views by a user
9) Describe 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 the 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 great help for the team to know what 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 Meeting and Imp Email
- Source Code
11) Explain About The Concept Of Synchronizing With The Repository & Tell Us About The Disparity Between Synchronizing And Updates?
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 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 includesSvn 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 writeSvn 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:
- GIT does not support the command “commit” across different branches or tags, but SVN makes it easy to create new folders in any part of your repository.
- GIT is considered to be unvarying where as SVN supports the function of multiple revisions.
- whereas SVN is the ideal choice for managing several projects that are kept in the same repository.
16) Differentiate The Concepts Of Commit And Update?
Ans:
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 repository. In much easier terminology it can be 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 a 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 undergone 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 merger 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) Which Is The Best Practice For Svn?
Ans:
- 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 the repository
- Watch for conflicts
- Always group your check-in logically
- Use comment
21) What Are “branch”, “tag” And “trunk” In Svn?
Ans:
- The trunk is the main body of development, originating from the start of the project till the end.
- The 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.
- A 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.
22) How Do You Apply A Patch In Svn?
Ans:
First “Create Patch” by making changes and generating the.diff file. The. diff file is able to be applied to the new code base by selecting “Apply Patch.”
23) 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.
24) 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.
25) Which command can be used to view the contents of the repository?
Ans:
Svn list file commandTo view the contents of the repository, type ///home/mysurface/repo/programming_repo.
26) What Command Is Used To See The distinction Between The Local And Repository Versions?
Ans:
the command uses to view the difference is ” svn diff “.
27) What is the purpose of the “revert” feature in Subversion?
Ans:
Subversion’s “revert” capability is used to undo changes made to files in the working copy, effectively reverting them to the state of the most recent update or commit.
28) 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
29) List Out The Common Subversion Commands?
Ans:
Common subversion commands include:- Import
- Checkout
- Commit
- Update
Other than these it also has commands like revert, move, copy, and merge.
30) How do you revert to a previous version of a file or repository in Subversion?
Ans:
To recover a prior version, use the “revert” command. However, the revert command will simply erase local edits; instead, use the “merge” command. For example, suppose you have a file [abc.txt] with a current version of 101 and want version 201. Then run a command like Svn merge -r 101:201 abc.txt.Svn merge –r 101:201 abc.txt
Svn commit –m “Reverted to revision 201” abc.txt
31) Which SVN commands can be used to move a subset of code and its history from one repository to another?
Ans:
The “svnadmin dump” and “svnadmin load” commands can be used to move a subset of code and its history from one SVN repository to another.
32) WhIch command is used to view the difference between the local version and repository version?
Ans:
The command used to view the difference between the local and repository version is- svn diff filename
- svn diff dirname
33) Mention 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 the 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
34) What is the SVN “checkout” command and how is it used?
Ans:
The “checkout” command in SVN is used to create a local working copy of a repository. It allows users to retrieve the latest version of files and directories from the repository onto their local machine for editing and version control.
35) List out which is the best practices for SVN?
Ans:
- Work from your own local workspace
- Commit small autonomous changes
- Use comment
- Validate the files you are committing, you actually changed
- Take an Update before committing to the Repo.
36) 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.
37) What are the different goals of Version Control System?
Ans:
Following are the goals of VCS:- It allows developers to work simultaneously.
- Do not overwrite each other’s changes.
- Maintain history of every version of everything.
38) 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.
39) 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.
40) 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.
41) 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.
42) 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.
43) 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
44) 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.1. What is the difference between Git and SVN?
Git | SVN |
---|---|
Git is a Decentralized Version Control tool | SVN is a Centralized Version Control tool |
It belongs to the 3rd generation of Version Control tools | It belongs to the 2nd generation of Version Control tools |
Clients can clone entire repositories on their local systems | Version history is stored on a server-side repository |
Commits are possible even if offline | Only online commits are allowed |
Push/pull operations are faster | Push/pull operations are slower |
Works are shared automatically by commit | Nothing is shared automatically |
45) 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.
46) 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.
47)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):
- Import existing code into the SVN repository
- Standard work cycle of development and testing
- 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.
48) 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 to 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
49) Work Cycle
Ans:
Once you have imported some code into the repository, you would typically follow this work cycle of development and testing:- Checkout a working copy of the code
- Make changes to the code
- Resolve conflicts
- Commit the updated code to the SVN repository
50) 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.
51) 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.
52) 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.