----------------------------------------------------------------------
--- Knud van Eeden --- 12 October 2007 - 07:28 pm --------------------

File: Version: Control: System: Program: Subversion: Operation: Run: Operating system: Microsoft Windows: How to: How to use Subversion? [tortoisesvn / TSE / GraphLib / VCS]

===

Steps: Overview:

 1. -Download and install Subversion
     (select the highest stable version number for Microsoft Windows)

--- cut here: begin --------------------------------------------------
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
--- cut here: end ---------------------------------------------------- Install e.g. default in the directory --- cut here: begin --------------------------------------------------
c:\program files\Subversion
--- cut here: end ---------------------------------------------------- You will then find the files svn.exe, svnadmin.exe, ... in the --- cut here: begin --------------------------------------------------
c:\program files\Subversion\bin\
--- cut here: end ---------------------------------------------------- directory there. 2. -Subversion stores all versioned data in a central repository. 1. -To begin, create a new repository. 1. -Create a master directory where you want to store the files of your project 1. -E.g. --- cut here: begin --------------------------------------------------
MD "c:\temp\subversion\mynewrepository\"
--- cut here: end ---------------------------------------------------- 3. -Inform Subversion about this directory --- cut here: begin --------------------------------------------------
svnadmin.exe create c:\temp/subversion/mynewrepository/
--- cut here: end ---------------------------------------------------- 4. -This command creates a new directory there which contains a Subversion repository. Make sure that this directory is located on a local disk, not a network share. This new directory mainly contains a collection of Berkeley DB database files. You will not see your versioned files if you check that directory. A directory structure is created there: --- cut here: begin --------------------------------------------------
> DIR c:\temp\subversion\mynewrepository\ 12-10-2007 15:32 <DIR> . 12-10-2007 15:32 <DIR> .. 12-10-2007 15:32 <DIR> conf 12-10-2007 15:32 <DIR> dav 12-10-2007 15:32 <DIR> db 12-10-2007 15:32 <DIR> hooks 12-10-2007 15:32 <DIR> locks 12-10-2007 15:32 2 format 12-10-2007 15:32 234 README.txt
--- cut here: end ---------------------------------------------------- 5. -Next, create some new tree of files and directories to import into that elsewhere created repository. (your directory structure should contain three top-level directories named branches, tags, and trunk) 1. -E.g. --- cut here: begin --------------------------------------------------
MD c:\temp\myproject\branches\ MD c:\temp\myproject\tags\ MD c:\temp\myproject\trunk\ REM move your files which you want to check to this trunk directory COPY c:\temp\ddd.bat c:\temp\myproject\trunk\ COPY c:\temp\ddd.txt c:\temp\myproject\trunk\ COPY c:\temp\mybbcbasicforwindows1.bbc c:\temp\myproject\trunk\ COPY c:\temp\mybbcbasicforwindows2.bbc c:\temp\myproject\trunk\ REM and so on ...
--- cut here: end ---------------------------------------------------- 6. -Once you have a tree of data ready to go, import this data into the repository (note: you will have to use forward slash '/' in the repository file path (instead of backward slash '\')). --- cut here: begin --------------------------------------------------
svn.exe import c:\temp\myproject\ file:///c:/temp/subversion/mynewrepository -m "This is my first import"
--- cut here: end ---------------------------------------------------- 7. -That will show the following: --- cut here: begin --------------------------------------------------
Adding C:\TEMP\myproject\trunk Adding C:\TEMP\myproject\trunk\ddd.bat Adding C:\TEMP\myproject\trunk\ddd.txt Adding C:\TEMP\myproject\branches Adding C:\TEMP\myproject\tags Committed revision 1.
--- cut here: end ---------------------------------------------------- 8. -Create your own personal working copy (which is a copy of the central repository), by using the command 'checkout'. You are supposed to be able now to do anything you want with this file (as this actions will not influence the *original* files in the central directory) -Now the repository contains your tree of data. At this point, you create a working copy of the trunk directory. --- cut here: begin --------------------------------------------------
> svn.exe checkout file:///c:/temp/subversion/mynewrepository project A project\trunk A project\trunk\ddd.bat A project\trunk\ddd.txt A project\branches A project\tags Checked out revision 1.
--- cut here: end ---------------------------------------------------- 9. -Now you have a personal copy of part of the repository in a new directory named 'project'. --- cut here: begin --------------------------------------------------
> dir c:\TEMP\subversion\ 12-10-2007 15:52 <DIR> . 12-10-2007 15:52 <DIR> .. 12-10-2007 15:32 <DIR> mynewrepository 12-10-2007 15:52 <DIR> project
--- cut here: end ---------------------------------------------------- 10. -You can edit the files in your working copy and then commit those changes back into the repository: 1. -Enter your working copy and edit a file (e.g. using your favorite text editor) 2. -Run 'svn diff' to see the changes done in your files 3. -Run 'svn commit' to send the new version of your file to the central repository. 4. -Run 'svn update' to synchronize your working copy with the central repository. 11. -Edit one of the files in your 'working copy' directory There are two kinds of changes you can make to your working copy: 1. -file changes 2. -tree changes You do not need to tell Subversion that you intend to change a file. Just make your changes using your text editor (e.g. TSE), word processor, graphics program, or whatever tool you would normally use. Subversion automatically detects which files have been changed, and in addition handles binary files just as easily as it handles text files, and just as efficiently too. --- cut here: begin --------------------------------------------------
@REM if using Notepad @REM notepad c:\temp\subversion\project\trunk\ddd.bat @REM if using TSE (adapt the path to the conditions on your computer) g32.exe c:\temp\subversion\project\trunk\ddd.bat
--- cut here: end ---------------------------------------------------- 12. -Change this file 1. -E.g. add a line containing the word: test and save your file 13. -Goto that working directory --- cut here: begin --------------------------------------------------
cd c:\temp\subversion\project
--- cut here: end ---------------------------------------------------- 14. -Now give Subversion commands: Check the difference --- cut here: begin --------------------------------------------------
> svn diff Index: trunk/ddd.bat =================================================================== --- trunk/ddd.bat (revision 1) +++ trunk/ddd.bat (working copy) @@ -1,3 +1,5 @@ +test
--- cut here: end ---------------------------------------------------- 15. -Now give Subversion commands: Send this latest update to the central repository, using the command 'commit' --- cut here: begin --------------------------------------------------
@REM fill in or change the path to your favorite text editor here (TSE, vi, emacs, textpad, ...) @REM SET SVN_EDITOR=notepad @REM adapt this path to the conditions on your computer SET SVN_EDITOR=c:\WORDPROC\tse32_v44078\g32.exe svn commit c:\temp\subversion\project\trunk\ddd.bat
--- cut here: end ---------------------------------------------------- -That will open the indicated editor, showing the following text: --- cut here: begin --------------------------------------------------
--This line, and those below, will be ignored-- M ddd.bat
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
Log message unchanged or not specified a)bort, c)ontinue, e)dit c
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
Sending trunk\ddd.bat Transmitting file data . Committed revision 2.
--- cut here: end ---------------------------------------------------- 16. -Now checking if there are differences (there should not be any because this updating which just happened) --- cut here: begin --------------------------------------------------
> svn diff
--- cut here: end ---------------------------------------------------- 17. -Other svn commands: Check the status, using the command 'status' --- cut here: begin --------------------------------------------------
> svn status ? trunk\svn-commit.tmp
--- cut here: end ---------------------------------------------------- 18. -Overview: Using another svn version (Cygwin svn.exe), the following command line output was generated: --- cut here: begin --------------------------------------------------
> md "c:\temp\subversion\mynewrepository\"
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
c:\cygwin\bin\svnadmin.exe create c:\temp/subversion/mynewrepository/ cygwin warning: MS-DOS style path detected: c:\temp/subversion/mynewrepository/format Preferred POSIX equivalent is: /cygdrive/c/temp/subversion/mynewrepository/format CYGWIN environment variable option "nodosfilewarning" turns off this warning. Consult the user's guide for more details about POSIX paths: http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
> dir c:\temp\subversion\mynewrepository\
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
Volume in drive C is OS Serial number is 6e38:fdbf Directory of C:\temp\subversion\mynewrepository\* 08-08-2010 11:30 <DIR> . 08-08-2010 11:30 <DIR> .. 08-08-2010 11:30 <DIR> conf 08-08-2010 11:30 <DIR> db 08-08-2010 11:30 <DIR> hooks 08-08-2010 11:30 <DIR> locks 08-08-2010 11:30 2 format 08-08-2010 11:30 229 README.txt 231 bytes in 2 files and 6 dirs 8,192 bytes allocated
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
> md c:\temp\myproject\branches\
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
> md c:\temp\myproject\tags\
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
> md c:\temp\myproject\trunk\
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
> copy con c:\temp\ddd.bat
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
con => C:\temp\ddd.bat @REM test ^Z 1 file copied
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
> copy con c:\temp\ddd.txt
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
con => C:\temp\ddd.txt This is a test ^Z 1 file copied
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
> copy c:\temp\ddd.bat c:\temp\myproject\trunk\
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
C:\temp\ddd.bat => C:\temp\myproject\trunk\ddd.txt 1 file copied
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
> copy c:\temp\ddd.txt c:\temp\myproject\trunk\
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
C:\temp\ddd.txt => C:\temp\myproject\trunk\ddd.txt 1 file copied
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
> svn import c:\temp\myproject\ file:///c:/temp/subversion/mynewrepository -m "This is my first import"
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
cygwin warning: MS-DOS style path detected: c:\temp\myproject\ Preferred POSIX equivalent is: /cygdrive/c/temp/myproject/ CYGWIN environment variable option "nodosfilewarning" turns off this warning. Consult the user's guide for more details about POSIX paths: http://cygwin.com/cygwin-ug-net/using.html#using-pathnames Adding c:\temp\myproject\/trunk Adding c:\temp\myproject\/trunk/ddd.txt Adding c:\temp\myproject\/branches Adding c:\temp\myproject\/tags Committed revision 1.
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
> svn checkout file:///c:/temp/subversion/mynewrepository project
--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------
cygwin warning: MS-DOS style path detected: C:/temp/subversion/mynewrepository/format Preferred POSIX equivalent is: /cygdrive/c/temp/subversion/mynewrepository/format CYGWIN environment variable option "nodosfilewarning" turns off this warning. Consult the user's guide for more details about POSIX paths: http://cygwin.com/cygwin-ug-net/using.html#using-pathnames A project/trunk A project/trunk/ddd.txt A project/branches A project/tags Checked out revision 1.
--- cut here: end ---------------------------------------------------- === Tested successfully on Microsoft Windows XP Professional (service pack 2), running Subversion svn-1.4.5-setup.exe === Book: see also: === Diagram: see also: === File: see also: === Help: see also: === Image: see also: === Internet: see also: File: Version: Control: Program: Subversion: Links: Can you give an overview of links? http://goo.gl/i1v4U === Podcast: see also: === Screencast: see also: === Table: see also: === Video: see also: === <version>1.0.0.0.4</version> ----------------------------------------------------------------------
Share |
This web page is created and maintained using the Semware TSE text editor