Home |
Last modified: 16-06-2020 |
Just like TortoiseCVS, TortoiseSVN is a Windows application can be used either as the client side of the open-source SVN source control manager (SCM), or be used as a stand-alone application for a single-user. Subversion is an improved CVS, as it lets you rename/move files and directories, and supports atomic commits. RapidSVN is another SVN client for Windows, based on wxWidgets.
Launch Windows Explorer, create a new directory, right-click on it, choose the TortoiseSVN menu, and choose "Create repository here".
"Most people create a trunk directory to hold the "main line" of development, a branches directory to contain branch copies, and a tags directory to contain tag copies. If a repository holds only one project, then often people create these top-level directories:
If a repository contains multiple projects, people often index their layout by branch (/trunk/paint) or by project (/paint/trunk).
For unrelated projects you may prefer to use separate repositories. When you commit changes, it is the revision number of the whole repository which changes, not the revision number of the project.
So if you haven't already created a basic folder structure inside your repository you should do that now:
This will import your temp folder into the repository root to create the basic repository layout."
"Before you import your project into a repository you should:
Now select the top-level folder of your project directory structure in the windows explorer and right click to open the context menu. Select the command TortoiseSVN > Import... which brings up the Import dialog box."
"Exclude patterns are used to prevent unversioned files from showing up e.g. in the commit dialog. Files matching the patterns are also ignored by an import. Exclude files or directories by typing in the names or extensions. Patterns are separated by spaces e.g. */bin */obj *.bak *.~?? *.jar *.[Tt]mp. The first two entries refer to directories, the other four to files. These patterns use filename globbing. Read Section 5.11.1, “Filename Globbing in Ignore Lists” for more information."
"Sometimes it is useful to construct a working copy that is made out of a number of different checkouts. For example, you may want different subdirectories to come from different locations in a repository, or perhaps from different repositories altogether. If you want every user to have the same layout, you can define the svn:externals properties."
"Sending the changes you made to your working copy is known as committing the changes. But before you commit you have to make sure that your working copy is up to date. You can either use TortoiseSVN > Update directly. Or you can use TortoiseSVN > Check for Modifications first, to see which files have changed locally or on the server."
"If your working copy is up to date and there are no conflicts, you are ready to commit your changes. Select any file and/or folders you want to commit, then TortoiseSVN > Commit...."
"Other commands are available as drag handlers, when you right drag files or folders to a new location inside working copies or when you right drag a non-versioned file or folder into a directory which is under version control."
"Sometimes you may want a copy without any of those .svn directories, e.g. to create a zipped tarball of your source. Instead of making a copy and then delete all those .svn directories manually, TortoiseSVN offers the command TortoiseSVN > Export...."
svnadmin hotcopy path/to/repository path/to/backup --clean-logs
From TortoiseSVN - A Subversion client for Windows Version 1.4.1
"A typical Subversion repository often holds the files (or source code) for several projects; usually, each project is a subdirectory in the repository's filesystem tree. In this arrangement, a user's working copy will usually correspond to a particular subtree of the repository.
Each time the repository accepts a commit, this creates a new state of the filesystem tree, called a revision. Each revision is assigned a unique natural number, one greater than the number of the previous revision. The initial revision of a freshly created repository is numbered zero, and consists of nothing but an empty root directory.
Unlike those of many other version control systems, Subversion's revision numbers apply to entire trees, not individual files. Each revision number selects an entire tree, a particular state of the repository after some committed change. It's important to note that working copies do not always correspond to any single revision in the repository; they may contain files from several different revisions.
svn commit commits a single file, while svn update uploads changes made to your entire working directory. It's not until you perform an update that the revision numbers of the files in your working directory will match those in the repository.
Each directory in your working copy contains an administrative subdirectory called .svn. For every file in a directory, Subversion keeps a copy of each file in the administrative area. This copy is an unmodified (no keyword expansion, no end-of-line translation, no nothing) copy of the file as it existed in the last revision (called the “BASE” revision) that you updated it to in your working copy.
To create a repository with Windows Explorer:
To access your local repository you need the path to that folder. If the repository lives on the local computer, use file:///C:/SVNRepository/. Note the use of forward slashes throughout.
If a repository contains multiple projects, you can create one directory per project (eg. /paint/trunk, /paint/branches, /calc/trunk, /calc/branches, etc.), but for totally unrelated projects, you may prefer to use separate repositories: When you commit changes, it is the revision number of the whole repository which changes, not the revision number of the project. Having 2 unrelated projects share a repository can mean large gaps in the revision numbers.
Next, let's create a structure in the repository:
You can also use the repository browser to create new folders directly in the repository.
Next, import the files into the repository:
"
If the disk structure is exactly the same, ie. same disk layout, same drive letter, same directory structure where the repository is living... you should be able to resume without TortoiseSVN noticing. Just make sure there's a /transaction sub-directory below repo/ .
Make sure there's no more than one point in its filename, eg. my.file.txt. If that's the case, change the extra dot with something else, eg. my_file.txt.
This is by design, and it's an SVN feature. Any change made to a repository increases the overall version number, regardless of where a file lives in the repository. In other words, if you imported two projects, eg. file:///C:/Repository/Project1 and file:///C:/Repository/Project2, check-in's will increase the version number, no matter what project a file belongs to. It actually doesn't really matter, since public releases use their own version number, while repository version numbers are used for internal purposes only, eg. Widget 1.0 build 1234 would refer to repository version 1234 which was used for the public release 1.0.
Pro's and con's in the following threads:
The file has to live in a work directory that is under source control. Right-clicking on a file that is located elsewhere will not display this item in the SVN pop-up menu.