Introduction:
-
- Subversion (SVN) is a centralized SCM (Software Configuration Management) implementation.
- It allows to track changes and concurrent development on the same files.
- Subversion is centralized version Control system, meaning that it uses central server to store all files and enables team collaboration.
The Goals of a Version Control System.
-
- Allow Developers to work simultaneously.
- Do not overwrite each other’s changes.
- Maintain history of every version of everything.
Centralized Version Control
Version Control Terminologies
Repository:
-
- A Repository is the heart of any version control system. It is the central place where developer 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.
- Clients can connect to the repository, and then they can store/retrieve their changes to/from repository.
Working Copy:
The working Copy is a private workplace, where developers can do their work remaining isolated from the rest of the team.
Commit Changes:
-
- Commit is a process of storing changes from private workplace to central server.
- After commit changes are made available to ALL THE TEAM. Other developer can retrieve these changes by updating their working copy.
- Commit is an atomic operation. Either the whole commit succeeds or is rolled back.
- User never see half- finished commit.
SVN workflow :
Branch:
One of the Most useful features of SVN is the ability to create branches to protect the source code from potentially destabilizing changes. Typically, Branching can be used to try out and develop new features without disturbing the trunk with errors and bugs.
Tags:
There is no difference between branch and tags in Subversion. Creating a tag is the same as creating a branch. The only difference is that the tag will be located inside of the tags directory instead of the previous Branches directory.
Setup SVN server in ubuntu 14.04
Login as a normal user, and update ubuntu repositories
#sudo apt-get update
Download apache2 https server and svn
#sudo apt-get install subversionapache2 libapache2-svn apache2-utils
Make a folder for saving SVN repositories
#mkdir -p /svn/
Edit dav_svn.conf file
#sudo vi /etc/apache2/mods-enabled/dav_svn.conf
Our setting file
<Location/svn>
DAV svn
SVNParentPath/svn
AuthType Basic
AuthName: “Subversion Repository”
AuthUserFile /etc/subversion/passed
Require valid-user
</Location>
Build account and password for SVN
#sudo htpasswd -c /etc/subversion/passwd user1
#sudo htpasswd -m /etc/subversion/passwd user1
Create SVN files for repository
#sudo svnadmin create /svn/testrepo
Set the permission to access those repositories
#sudo chown -R www-data: www-data/svn
Restart Apache2 Server
#sudo /etc/init.d/apache2 restart
Check SVN is ready or not
URL:- https://localhost/svn/”Repository Name”