C++ HOWTO,
Republican
Guide to Linux and
C++ Essential Questions and Answers
Copyright © Marcel Lambert
Typically, when you often operate with text files that require revisions before their release or when you are concerned with traceability of changes in your own files it is a fair indication that you might need to think about source control system for your text files even if these files are not supposed to be used in shared mode with other users. |
Windows | Linux |
TortoiseSVN is the source control system integrated with Windows Explorer, and is based on SVN source control system earlier introduced with Linux. SVN itself was inspired by CVS source control system used with Unix since 1990 (and later with Linux). The advantage of TortoiseSVN is that Windows repository created with TortoiseSVN can be used as repository when accessing with Linux-based client SVN tools. This Windows/Linux interoperability along with integration with Windows Explorer sounded appealing for me when I opted to use TortoiseSVN for my own projects. One other benefit of TortoiseSVN is that it is able to compare Word files (though not side-by-side, v1.4.5), and works with UNICODE. As with any source control system you should plan a central repository. It is a good idea to place repository on file server or use internet server, and use shared drive if the repository should be accessed from Windows and Linux. In simple cases, you can choose flash drive. To setup SVN repository after running setup program make new folder (SVN for example), right-click and choose Create repository here... . If you'd try to create repository starting from not-empty folder, the TortoiseSVN will be complaining, which means that repository can be created from empty folder only. Once repository is created, you can add files (and folders) to the SVN repository. You do this with Repo-browser, which can be invoked by right-click on repository, choosing TortoiseSVN, and then Repo-browser. Now, when you need to work with repository files locally, you first make a checkout (right-click on repository and choose SVN Checkout... or checkout from repo-browser). For the destination of the local copy choose any location such as MyDocuments/LocalSVNCopy. TortoiseSVN enables right-click menu for the folder where you made a checkout. The new context-menu items are also available for local files. Notice that TortoiseSVN adds red exclamation mark to the left bottom of an icon of locally edited file, and green mark if a local file was not edited since last checkout. The same meaning have green and red marks for folder icons. In fact, it is convenient to identify folder as local SVN copy by these folder marks. Among menu items that SVN adds for locally edited file, the most useful is Diff option, which makes possible to see differences between local and server (repository) versions. Don't forget to update repo files if you make changes to the local copy (right-click on file and choose SVN Commit...). The accidental destruction of the local copy can cause no harm if you did not forget to make commits after updates of the local files. To restore local copy you simple make a checkout from the relative repo. When new file is added to the repositoy, you can load it to the local directory by right-click on local project folder and choosing SVN Update. If you have programming experience with Microsoft development tools, you can jumpstart using TortoiseSVN having in mind that mode of operations with TortoiseSVN is based on paradigm used with other source control systems. Take a look on Visual Source Safe window, which is the Windows source control system provided by Microsoft basically for version control of source files while programming. The TortoiseSVN's analog of Visual Source Safe Explorer is already mentioned Repository Browser. |
With Linux there are 2 major options1. The first one is to use CVS, and the second is to rely on Subversion (or SVN), which inherits major CVS features and claims removing some shortcomings observed in CVS. If circumstances do not require from you to use CVS, the use of SVN might be a better option, especially if you need to track versions of UNICODE files. On the other hand the use of CVS is simpler, more intuitive, and CVS is integrated with KDE by default through Konqueror file manager, even though you can use a separate UI frond-end for CVS called Cervisia (cervisia). Cervisia enables you to setup a CVS repository and run basic tasks such as commit, checkout, update, adding files, viewing version differences without running these tasks in command-line interpreter. Sure you can use console (konsole), but unless you use CVS everyday keeping in mind its commands might not be a reasonable and easy exercise (see the list of relative commands with: # cvs --help-options or enter man:cvs in Konqueror's address bar). The next steps show you how to setup an empty CVS repository from scratch so that files and folders can be added later. It is a good idea to setup repository on file or internet server, however, for simplicity, you can use flash-drive for tests:
With Linux, SVN has become de-facto standard for users and developers who want to obtain latest versions of source code for a package to build it on local machine albeit obtaining source with FTP is no less practical. Frequently, a user needs a few SVN commands such as checkout, which can be effectively run (and bookmarked within console) from console (konsole), without invoking UI-enabled front ends. For this reason, I provide here in a nutshell basic steps necessary to setup SVN repository without UI-enabled tools (the order of steps reflects the steps with CVS repository setup). As before you can use for tests flash-drive:
With KDE and GNOME come KDESvn (kdesvn) and RapidSVN (rapidsvn) programs relatively that enable you to accomplish source control tasks within graphical interface avoiding the use of console commands (you still need to create repository in console when using RapidSVN). These programs represent UI front-ends to Subversion (SVN commands). The sequence of steps to create a new repository and add to it a file are the same as described when using console:
The pictures used above were obtained with Cervisia v2.4.9 and KDESvn v0.11.2 3. |
Email me: lambert1791 at gmail dot com. |