svn的基本操作

install:
    sudo apt-get install rapidsvn
    sudo apt-get install meld
    

bookmark a repository:

    1.Under the Bookmarks menu select Add Existing Repository...
    2.Type the URL (e.g. http://TagentServer/svn/DIR) and click OK
    

Edit a file (via Checkout) and Checkin the changes (via Commit):

    1. Using therepository bookmark created in the prior step, browse to the parentdirectory (or higher) that contains the file to be worked with.
    2. In theBookmark browser, right-mouse click the desired parent directory andselect Checkout New Working Copy... from the context menu.
    3. The URL willalready be filled out (make sure it’s just the directory and doesn’tcontain the filename (a bug), if you don’t remove the filename you’llget an error).
    4. Enter yourlocal path in the “Destination Directory” and click OK.  This willpopulate your hard disk with the files and create a bookmark.
    5. Browse the bookmark in RapidSVN to the file to be edited and double-click the file.
    6. Afterediting and saving the file, reactivate the RapidSVN window. The statusfor the file should now indicate “modified”.
    7. In theright-hand window, right-mouse click on the modified file and selectUpdate... to update your file with any changes by other members of yourteam. If the status of the file remains “modified” it is safe toproceed to the commit step. If the file status shows “conflicted” youshould resolve the conflicts before committing.
    8. In the right-hand window, right-mouse click on the modified file and select Commit...
    9. Enter a log message that briefly describes your changes and click OK.
    
    
Undo a local edit (via Revert):

    1. Make another change to the file we worked with in the prior section and save it.
    2. Switch back to RapidSVN and in the right-hand window, right-mouse click on the modified file and select Revert.
    3. Click OK to the Revert dialog and observe the changes made in Step 1 have been lost.
    
       
Add a file (via Add)
    
    1.In theright-hand window, right-mouse click on the file to be added and selectAdd. (If a file was Added by mistake, use Revert to undo the Add)
    2.Right-mouse on the file in the prior step and select Commit....
    3.Enter a message in the log window and click OK.
    
    
Add a directory (via Add recursive)

    1. Create a new directory in the directory we have been working in.
    2. Add a file or two. You can even create a subdirectory with more files in it.
    3. Return to RapidSVN. In the right-hand window you will notice the new directory appears as "unversioned".
    4. Right-mouse on the new directory and select Add recursive.
    5. Right-mouse on the new directory again and select Commit....
    6. Enter a message in the log window and click OK.
    

Option 1: Add a directory via Import

    1. In the Bookmark browser, select the repository you want to add the directory to.
    2. From the Repository menu select Import....
    3. For the"Repository URL" make sure you specify the full path to the newdirectory. For example, if I wanted to add the Reader directory to thepath //TagentServer/svn/RFID/ enter http://TagentServer/svn/RFID/Readerfor the "Repository URL".
    4. Next enter your local path in the "Path" field. In this example we’ll use /Users/gerrior/Projects/RFID/Reader.
    5. Type something in the "Enter log message" field.
    6. Confirm "Recursive" and "Path type:" "Tree" are selected and click OK.   

    A1. Rename thedirectory you just imported (.e.g. \Reader to \Reader.orig). If you donot do this, you will receive the error "object of the same namealready exists" when you perform the next step. Checkout does not allowyou to overwrite existing files.
    A2. In theBookmark browser, right-mouse click the newly imported  directory (e.g.\Reader) and select Checkout New Working Copy... from the context menu.
    A3. The URLwill already be filled out (make sure it's just the directory  anddoesn't contain the filename (a bug), if you don’t remove the  filenameyou'll get an error).
    A4. Enter yourlocal path in the “Destination Directory” and click OK. This willpopulate your hard disk with the files and create a bookmark.   
    
    
       
Option 2: Add a directory to the repository

    1. In theBookmark browser, select the parent directory for the new directory.This can be the repository bookmark or a subdirectory.
    2. In the right-hand window, right-mouse in an empty row and select Make directory... F7.
    3. In the Bookmark browser select the new directory (you may need to refresh the view).
    4. Right-mouse and select Checkout New Working Copy... , specifythe "Destination Directory" and click OK.
    5. Now you canadd your files as we did previously. (You may need to select anotherbookmark and then select the new bookmark again in order for the filesto appear. Refresh View doesn't work in this scenario.)     
    
       
       
Checkout a Working Copy

    1. Click on the 'Repository' menu
    2. Click on the menu item 'Checkout.. (CTRL-O)', this will open the 'Checkout' dialog box
    3. Enter the URL of the Subversion repository in the 'URL Text box'
       4. Select a local directory for your sandbox (working copy)
       5. Click the 'OK' button
       
       

View an existing subversion sandbox (working copy) with RapidSVN

    1. Right click 'Bookmarks'
    2. Click 'Add Existing Working Copy'
    3. Browse for the root of the local copy
    4. Click the 'OK' button
    
    

Update your Working Copy

    1. In the Bookmark browser, right-click on a directory and select Update. Click OK to the Update dialog box.
    2. If a file was deleted in the repository, it will be deleted from the working copy.
    3. If a filewas deleted locally with the intent of retrieving the latest copy fromthe repository - the Revert command should be used.
    
    
       
Copy/Branch/Tag/Move/Rename

    * Copy is copying the file to the new location and leaving the source file untouched.
    * Branch is the same as Copy.
    * Tag is the same as Copy.
    * Move is copying the file to the new location and deleting the source file.
    * Rename is the same as Move.       
    
    
       
Merging : Assuming you want to merge branch1 and branch2,

    1. Update your local copy of branch1 from the repository
    2. Update your local copy of branch2 from the repository
    3. Select Merge... from the Repository menu
    4. In the "First working copy or URL", enter the local address of branch1
    5. In the "Second working copy or URL", enter the local address of branch2
    6. Enter revisions in the two "Revision" boxes (see below).
    7. In "Destination path", enter the local address of the folder you'd like your merge to be created in
    8. Click OK
    9. Select thelkocation where your merge has been placed and Commit it to the remoterepository (use Ctrl-M, the toolbar icon, or Modify > Commit).     
    
       
       
Export from the Repository

    1. Click on Repository and choose Export...
    2. In the "URL"box, type the URL of the repository you wish to export. You don't haveto export the whole respository, you can export individual files ordirectories if you wish.
    3. In The "Destination Directory", type the path to the location you wish to export to.
    4. Click OK
   

你可能感兴趣的:(svn的基本操作)