Thursday, August 27, 2009

Subversion: Client: Installation and Guidelines

This is the third section of the Subversion topic. The first and second sections can be found here and here.

Note: This topic is more like a walk-through than a complete guidelines. And is basically based on the great documentations found on the TortoiseSVN website and various sources. You can refer the site for more explanation if needed.

Client: Installation and Guidelines

Part 1: Installation
  1. Install TortoiseSVN (e.g. TortoiseSVN-1.4.X.XXXX-win32-svn-1.4.X.msi).
    • After installed, right click > Settings > General >
    • Tick Use "_svn" instead of ".svn" directories
    • Tick Set fildates to the "last commit times"

Part 2: Importing Data Into A Repository and Checking Out From A Repository
  1. Before importing, please organize the project folder and take away unused files that are not needed to build the project.
  2. Right-click on the (top-level) project folder, select TortoiseSVN > Import. All the contents of the folder will be imported into the repository, under version control.
  3. The project folder used for importing is unversioned and cannot be used for "Check Out" (See "Check Out A Working Copy" below). If the project folder (source tree) is also used as the working copy, you have to either:
    • After the folder is imported into the repository, delete the folder, then do "Check Out" to a new folder with the same name, or
    • "Check Out" to a different folder, or
    • "Check Out" to an empty folder, then copy the content to the folder. Select TortoiseSVN > Add to add the files needed for version control. Then TortoiseSVN > Commit.
  4. Check Out A Working Copy (client):
    • To obtain a working copy from a repository. Only can check out into an empty folder.
    • Right-click on an empty folder > SVN Checkout
    • Can be perfomed on a sub-directory path instead of the whole repository path. Then the client only need to check out on the part that needed (e.g. trunk only).
    • The "Check Out" folder contents are now under version control.
  5. If certain folders/files need to be ignored, select TortoiseSVN > Add to ignore list, or TortoiseSVN > Properties, Add "svn:ignore", put the ignore pattern. E.g.:
  6. [Bb][Aa][Cc][Kk][Uu][Pp] [Uu][Nn][Uu][Ss][Ee] [Uu][Nn][Uu][Ss][Ee][Dd] *.[Bb][Aa][Kk] *.[Tt][Bb][Kk] *.[Ee][Xx][Ee] *.[Ee][Xx][Ee][1_]
Part 3: Daily Use Guide
  1. All TortoiseSVN commands are accessed with right-clicking on a file or folder. The versioned folder contents will be indicated with icon overlays. TortoiseSVN also provide right-drag functions.
  2. Checking The Working Copy:
    • Right-click > TortoiseSVN > Check for modifications (To see changes in the client)
    • Click "Check Repository" to see changes in the server
  3. Update The Working Copy:
    • Right-click > SVN Update (update the client)
    • Default update is from the repository's HEAD revision.
    • To update from a different revision (not recommended), select TortoiseSVN > Update to revision.
    • Note: SVN will never overwrite unversioned files.
  4. Commit Changes To The Repository:
    • Select any file/folder, right-click > SVN Commit > Select the changed files to be commited.
    • Only commit if the working copy is up-to-date and there are no conflicts.
    • Optionally, write a log message to describe the changes.
    • Optionally, files/folders can be ignored, refer here
  5. If there are conflicts during update or commit, either:
    • Double-click/right-click on the file to launch the diff/merge tool to show the changes (only for non-binary files), or
    • Manual checking and resolving the problem, or
    • TortoiseSVN > Resolve, to commit overwrite the repository, or
    • TortoiseSVN > Revert, to update overwrite the client
    • Refer: here
  6. To Add/Delete/Rename on version controlled files/folders, etiher:
    • Modify as usual in Windows Explorer, or
    • Right-click > TortoiseSVN > Add/Delete/Rename
  7. To undo changes in client:
    • TortoiseSVN > Revert, to update overwrite the client.
Reference: File Version Used:
Subversion (svn): 1.4.5
TortoiseSVN: (win32)
Cygwin: 1.5.25-14
Putty, Puttygen, Pageant: 0.60

If you find this post helpful, would you buy me a coffee?

No comments:

Post a Comment