Source Version Control Using Subversion by Mangesh Bhujbal
Source Version Control Using Subversion by Mangesh Bhujbal
Working Copy 1
(Checked out from Trunk)
Subversion Repository
Working Copy 2
(Checked out from Trunk)
Subversion Workflow
Developers checkout code from the repository to a local workingcopy. After making edits in working copy, they commit the changes to the repository. At any point, they can revert to an older version of the codebase. They update their local working copy frequently to keep up with changes. In case of conflict, then resolve the conflict.
Subversion Tools
Command Line
sudo apt-get install subversion libapache2-svn svnadmin create /path/to/repos/project Edit /conf/svnserve.conf file and menion the passwd file to be used for authentication, & disallow anonymous access sudo svnserve -d -r /path/to/repos svn co svn://IP-Address/path/to/repos/project/trunk/ test_checkout/ -username user_name svn update svn status svn commit --message "Add a few more things"
Subversion Tools
GUI
TortoiseSVN
Right-click a directory and get a context-menu with everything in there.
Project Layout
trunk/
This is the main working branch.
branches/
In this folder we will have two branches for Staging and Production.
tags/
Whenever we do release, we will label the trunk code and store it in this folder.
Note: The basic differences between Branch & Tag is, on Tag we are not suppose to work, it is a snapshot and on Branch we can work and later merger it with main branch
Best Practices
Take svn update often to avoid the conflict. Do not commit the config file in the repository. Do not copy the working copy folders as it is to other working copy. Check-in the DB scripts as well. For deleting/renaming files/folders use TortoiseSVN context menu. While committing any changes compare it first and then commit.
Demo Q&A