160 likes | 376 Views
Subversion (SVN) Collaborative Coding. Pressented by: Asima Latif. What Is Subversion?. It is a general system that can be used to manage any collection of files. TortoiseSVN is a Subversion client, implemented as a windows shell extension, a plug-in to Windows Explorer
E N D
Subversion (SVN)Collaborative Coding Pressented by: Asima Latif
What Is Subversion? • It is a general system that can be used to manage any collection of files. • TortoiseSVN is a Subversion client, implemented as a windows shell extension, a plug-in to Windows Explorer • Subversion is a free/open source version control system. • Subversion manages: • Files directories, • The changes made to them, over time. • This allows you to: • Recover older versions of your data • Examine the history of how your data changed.
SVN operation • operate across networks, • allows it to be used by people on different computers. • encourage collaboration (group efforts). • Progress can occur more quickly without a single conduit (channel). • No conduit can be lost. • No trade-off quality • Undoing the incorrect changes can be possible.
Is Subversion the Right Tool? • Bad: • administrative overhead. • need to manage a data repository to store the information and all its history, • attentive about backing it up • photos, digital music, or software packages doesn’t change at all, replicating such data is not is overkill. • Good : • If you need to archive old versions of files and directories, possibly resurrect them, or examine logs of how they've changed over time, • If you need to collaborate with people on documents (usually over a network) and keep track of who made which changes, • This is why Subversion is so often used in software development environments
Getting new Data into Your Repository svn import and svn add Note that after the import is finished, the original tree is not converted into a working copy. To start working, you still need to svn checkout a fresh working copy of the tree. Help! svn help Update your working copy. svn update Make changes. svn add svn delete svn copy svn move Examine your changes. svn status svn diff Possibly undo some changes. svn revert Resolve conflicts (merge others' changes) svn update svn resolve Commit your changes. svn commit How to use SVN?
Examining History • svn log • Shows you broad information: log messages with date and author information attached to revisions and which paths changed in each revision • svn diff • Shows line-level details of a particular change • svn cat • Retrieves a file as it existed in a particular revision number and displays it on your screen • svn list • Displays the files in a directory for any given revision • svn status , , svn status will display an L next to locked items • svn cleanup
TortoiseSVN installation • The latest version can be downloaded at http://tortoisesvn.sourceforge.net/downloads. • For my 32-bit processor I used 32 Bit TortoiseSVN-1.3.5.6804-svn-1.3.2.msi Installer. • This installation is also straightforward, just accept the defaults.
Note, that after installation your Windows Explorer has extra buttons in the main menu Suppose your project resides in C:\Projects\MyProject. It contains files and possibly subdirectories:
Step 0 (Optional). Global ignore pattern setting. You probably do not want to keep track of temporary and some other types of files. Right-click on any folder, and launch TortoiseSVN/Settings: Alternatively
Step 1. Repository creation. On your hard drive create the directory for repositories of all your projects, e.g. C:\SVN. Create inside it a sub-directory\MyProject. Right-click on MyProject and choose TortoiseSVN/Create repository here: This converts C:\SVN\MyProject into a repository with the following contents: Select the default Native FileSystem (FSFS) option and click the OK button: So far this is an emptyrepository, even though Subversion has created several directories and files! We need to fill it with our project files and connect it with our working project directory. All this required several, sometimes counter-intuitive actions.
Step 2. Initial import. Somewhere in your hard drive (e.g. in C:\tmp) create a directory (e.g. \new) with the following three subdirectories:C:\tmp\new\branches C:\tmp\new\tags C:\tmp\new\trunk The resulting structure is: • Backup your project (C:\Projects\MyProject.), just in case.Delete all unnecessary files that are not included in your global ignore list Move the contents of \MyProject into the trunk subdirectory (C:\tmp\new\trunk). We will need an empty directory later, anyway. Import the 'new' directory into the repository (Right-click/TortoiseSVN/Import):
Selelect URL as file:///C:/SVN/Myproject (forward slashes!): • The "Import finished" message shows C:\tmp\new\* : Right-click on C:\SVN\MyProject and start TortoiseSVN/Repo-browser:
Navigate to file///C:/SVN/MyProject/trunk: • Step 3. Creating a working directory. Now you have the repository with all your files and the empty C:\Projects\MyProject • Right-click on C:\Projects\MyProject and choose "SVN Checkout":
Set URL to file:///C:/SVN/MyProject/trunk and Checkout directory to C:\Projects\MyProject: Press OK. Checkout has finished: The changings are reflected in the small icons on your project directory and all containing files (and subdirectories).
Sending (checking in) your changes to the repository: Right-click on selected files then "SVN Commit" • Adding files to the repository. This is a two step process: • Right-click on selected files then "TortoiseSVN/Add" • Right-click on selected files then "SVN Commit"