AnkhSVN使用【转载】

 

  1. Where to download AnkhSVN
  2. How to Install AnkhSVN
  3. How to use AnkhSVN

For more information on Subversion in general, refer to the Subversion book.

You will also want to take a look at the document entitled "Using Subversion in the .NET Environment"

Where to download

Click here to download the (AnkhSVN.0.6.0.2461) version


How to Install AnkhSVN

Once you have downloaded the AnkhSVN client, you need to install this client on your system. Here are the steps to install this client:

Step 1:

Locate the path where you have downloaded AnkhSVN installer for example, C:\Program Files\AnkhSetup-0.6.0.2439-snapshot_32. Double click the file
AnkhSetup-0.6.0.2439-snapshot_32 to start the installation


Step 2:

The first dialogue of your installer will display a welcome message. This dialogue will give some help tips to continue with the installation. Throughout the installation process, to continue to the next dialogue, click 'Next' button and to abort the installation process click 'Cancel' button





Step 3:

The next dialogue of your installer will require you to accept the License Agreement of AnkhSVN. Read the license agreement and select the 'I Agree' option and click 'Next'.
The installation cannot proceed if you select 'I Do Not Agree' option





Step 4:

Enter the path in which you wish to install the AnkhSVN plugin. In the 'Install AnkhSvn for yourself or for all users that share this computer:', option choose the suitable option:





Step 5:

The installation begins here. If you wish to abort the installation, click <Cancel> button





Step 6:

Once the installation completes successfully, the last installer dialogue will be displayed with a success message. Click the <Finish> button to complete the installation process





How to use AnkhSVN

Let us now learn to execute some basic Subversion commands using AnkhSVN. This set of instructions is for VS.NET Professional Edition only. The steps may differ for VS.NET Team Edition

AnkhSVN is a Visual Studio .NET addin for the Subversion version control system. It allows you to perform the most common version control operations directly from inside the VS.NET IDE

General

Once you have successfully installed AnkhSVN you would find it as one of the menu options on Visual Studio.Net main window.

You would also find the AnkhSVN commands in the right click pop up menu in the solutions explorer window of Visual Studio.NET.





Add a Solution to your Subversion repository

Now that you have AnkhSVN installed, you can now version control your VS.NET Content in a Subversion repository. To start saving your content in Subversion, make sure to have created your subversion repository. Lets say for example, the repository we have created has the URL https://foobar.collabnetdemo.net/. Let us now add the solution to the Subversion repository

  1. Right click on the solution
  2. Click on 'AnkhSVN' option in the right click pop up menu
  3. Select the 'Add solution to Subversion repository...' option

  4. To add the solution to the directory 'src' of your Subversion repository, enter the complete path to this directory i.e https://foobar.collabnetdemo.net/svn/foobar/trunk/src/ in the 'Add solution to repository' window.

    You can also add the solution to a new subdirectory by clicking the 'Create subdirectory' checkbox. You can give a name to the subdirectory and a log message.

  5. Click the 'OK' button
  6. A progress bar will be displayed while the solution is being addded to the subversion repository

  7. If your subversion repository uses cetificates, a window authenticating it will be displayed. Click 'Accept' button. You can check the 'Store credentials?' check box to ensure that the certificate check is not performed everytime.

  8. Enter the username and password to the Subversion repository in the 'Authenticate' dialogue. You can check the 'Store credentials' check box to save the username and password entered here.
  9. After authenticating the user, the 'Commit' window must be displayed. You can enter a log message of your choice in the text box and click 'Commit'

  10. A success message 'Committing added files' must be displayed in the output window. You will also find a tick mark against your solution file in the Visual Studio.NET window once the changes are committed.

Adding more items

Once the solution has been added to the Subversion repository, any item added to the solution is automatically queued for being added to the Subversion repository. The item needs to be committed to get added to the Subversion repository

  1. Add a new item to the solution, say a text file namely foobar1.txt
  2. Right click on the newly added item, foobar1.txt
  3. Click on 'AnkhSVN'
  4. Click on 'Add' sub menu

  5. In the 'Select items to add' window, put a check mark against all items to be added. In this case we have only 'foobar1.txt' file. Click 'OK'

  6. Once the item has been queued for addition, right click on the item and select 'Commit'

  7. In the commit window, enter a log message, click 'Commit'

The item will now be committed to the Subversion repository. Look for a check mark against the item to confirm that the item was committed to the Subversion repository.

Modify the items

To modify the items:

  1. Open the item say foobar1.txt
  2. Modify and save the file
  3. There must be an 'M' symbol displayed against the file which indicates that the file has been modified
  4. Right click on the filename, click 'Commit'

  5. In the commit window, enter a log message, click 'Commit'

The changes must now be sent to the Subversion repository. The item as well as parent solution must now have a check symbol against their names. The success message must also be present in the output window

Update

To update the items:

  1. Right click on the filename, click 'Update'.
  2. In the update window, check all the items that you wish to update. In this case we have foobar1.txt alone. Select it and click 'OK'
    When you update a folder, you can check the 'Recursive' check box to update the subfolders and files inside the folder.

Revert to revision

To revert to an old version of a document:

  1. Right click on the filename, click 'Revert to Revision' under 'AnkhSVN' menu

  2. Enter the revision of the document you wish to revert to in the 'Choose the revision you want to rever to' text box in 'Reverse Merge' window

  3. Click 'OK'
  4. In the 'Microsoft Development Environment' window, click 'Yes' if you wish the modified document to be opened

The modified document will get opened

Revert

To revert changes made to a document:

  1. Right click on the filename, click 'Revert' under 'AnkhSVN' menu

  2. Select all the files of which you wish to revert the changes in the 'Select items to revert' window

  3. Click 'OK'
  4. Click 'OK'
  5. In the 'Microsoft Development Environment' window, click 'Yes' if you wish the modified document to be opened

Retreiving the log messages

If you wish to view the log messages entered by users while committing changes to this file, do the following

  1. Right click on the filename, click 'Log' sub menu from the 'AnkhSVN' menu

  2. Enter the range of revisions in which you wish to view the log messages in the 'Revision Start' and 'Revision End' text fields of the 'Log' window

  3. Click 'OK'
  4. The 'Retreiving log' window will be displayed while the log messages are being fetched
  5. Check the 'Log' tab to view the log messages

Lock

If you wish to prevent the item you are working on to be edited by other users, you can place a lock on the file. This will ensure that you are the only user able to edit the file. This reserves a right for you to commit the file first

  1. Right click on the filename, click 'Lock' sub menu from the 'AnkhSVN' menu

  2. Enter a lock message

  3. Click 'OK'
  4. The 'Locking files' window will be displayed while the file is being locked
  5. After the file is locked, you'd find a lock symbol next to your file

Unlock

To release the lock obtained on a file, you must unlock it. This will make it possible for the other users to be able to edit the file.

  1. Right click on the filename, click 'Unlock' sub menu from the 'AnkhSVN' menu

  2. In the 'Unlock files' window, click 'OK'
  3. The 'Unlocking files' window will be displayed while the file is being unlocked
  4. After the file is unlocked, the lock symbol will be removed

Blame

If you wish to know the changes a file went through in the various revisions, you can use the blame option. This will list the users who changed the item.

  1. Right click on the filename, click 'Blame' sub menu from the 'AnkhSVN' menu

  2. In the 'Blame' window, enter the revision range in which you wish to know the changes. Use the 'Revision Start' and 'Revision End' text fields to enter the revision range

  3. Click 'OK'
  4. The 'Figuring out who to blame' window will be displayed while the information is being retrieved
  5. You will find the information about the changes the file went through in the 'Blame' tab

Clean Up

Sometimes a repository gets locked due to some incomplete commits

  1. Right click on the main solution, click 'Clean up' sub menu from the 'AnkhSVN' menu

    >

  2. After a successful clean up, the success message will be displayed in the 'AnkhSVN' window

Relocate

This command is very rarely used. If your repository URL changes, you need create your repository all over again. You can use the relocate command to make your repository point to the new URL

  1. Right click on the main solution, click 'Clean up' sub menu from the 'AnkhSVN' menu

  2. Enter the old repository URL and the new repository URL in the 'From' and 'To' text boxes respectively

  3. Your repository will not point to the new URL

Resolving a conflict

Conflicts occur when two or more developers change the same few lines of a file. In such cases, AnkhSVN fails to merge changes automatically. The changes must be merged by the users manually

  1. If you find an exclamation symbol next to your file name, this means there's a conflict that has taken place

  2. Look in the directory where you have saved your project, you will find three new hidden files namely filename.ext.mine , filename.ext.rOLDREV and filename.ext.rNEWREV
  3. Right click on the file and select 'Resolve conflicted file...'

  4. The four files (Conflicted file and the three new files) will be displayed as options. Choose the file that you want to make as the final version

    • filename.ext: This will have the conflicts in it. After choosing it you will have to correct the conflicts manually. Merge the changes by deleting the unwanted text
    • filename.ext.mine: File that existed in your working copy before doing 'Update'. It will contain your latest changes. However, the changes done by other developers will be lost
    • filename.ext.rOLDREV: File as it existed before you made your changes. If you choose this the changes done by you and other developers will be lost
    • filename.ext.rNEWREV: File that SVN client received from the repository. This corresponds to the HEAD revision of the repository. If you choose this option, your changes will be lost
  5. Choose the option which suites you best and click 'Resolve'.
  6. If you had chosen one of filename.ext.mine, filename.ext.rOLDREV or filename.ext.rNEWREV, the system will prompt you to reload the file with modified contents, click 'Yes'
  7. After the conflicts a resolved, the file will be displayed in modified state. and the additional files will be deleted
  8. Commit the file to save the changes permanently

Repository Explorer

If you wish to view the hierarchy of the repository:

  1. Click on 'Tools' option in the main menu and select 'Repository Explorer' option under 'AnkhSVN'

  2. Click on the 'Repository Add' button in the 'Repository Explorer' window

  3. In the 'Add respository URL' window, enter the URL of the Subversion respository of which you wish to view the hierarchy and click 'OK'

  4. The URL will get added to the repository URL list. Expand each of the directories by clicking the '+' symbol. Each time a directory is expanded, the 'Retreiving directory info' window will be displayed

Commit log dialog

To view the commit log dialog:

  1. Click on 'Tools' option in the main menu and select 'Show the commit log dialog' option under 'AnkhSVN'

  2. The commit log dialogue window will be displayed

Send suggestion error report

If you wish to alert the AnkhSVN team regarding any error, you can use the 'Error report' option

  1. Click on 'Tools' option in the main menu and select 'Send suggestion error report' option under 'AnkhSVN'

  2. The 'Compose new' mail window of your email client will open and the mail will be addressed to: error@ankhsvn.tigris.org with the subject 'Exception'. The version of AnkhSVN will automatically be filled up

Switch

If you wish to switch between branches, use the 'Switch' option

  1. Right click on the filename, click 'Switch' sub menu from the 'AnkhSVN' menu

  2. Enter the URL of the branch you wish to switch to in the 'Switch to' field

  3. Click 'OK'
  4. The 'Switching' window will be displayed while the branch is being switched

Exporting a Subversion repository to local directory

If you wish to export a Subversion repository to your local directory you can do the following:

  1. Click on the 'Tools' menu and choose 'Export a repository or a local directory' from 'AnkhSVN' submenu

  2. In the 'Export' window, select whether you wish to export from a Local directory (SUbversion working copy) or a URL (Subversion repository)

  3. Select the 'Export from URL' or 'Export from local directory' radio button
  4. If you chose 'Export from URL' option, enter the Subversion repository URL in the 'URL' field. If you chose the 'Export from local directory', enter the Subverion working copy path in the 'Local directory' field. Note that this field label will change automatically as you pick your option
  5. The 'Exporting' window will be displayed while the project contents are being exported

Checking out a Subversion repository contents

If you wish to checkout a Subversion repository to your local directory you can do the following:

  1. Click on the 'Tools' menu and choose 'Checkout a repository directory' from 'AnkhSVN' submenu

  2. In the 'Export' window, enter the Subversion repository URL in the URL field
  3. Select a local directory path in which the repository contents will be checkedout in the 'Local Directory' field and click 'OK'

  4. The 'Checking out' window will be displayed while the project contents are being checked out

Edit the AnkhSVN config file

If you wish to edit the AnkhSVN config file you can do the following:

  1. Click on the 'Tools' menu and choose 'Edit AnkhSVN config file' from 'AnkhSVN' submenu

     

  2. The configuration file 'ankhsvn.xml' will open up which you can modify to set your configurations

Disable Ankhsvn for a solution

If you wish to disable AnkhSVN for a solution, you can do so by choosing the 'Disable AnkhSVN option'

  1. Right click on the solution, click 'Disable AnkhSVN for this solution' sub menu from the 'AnkhSVN' menu

转载于:https://www.cnblogs.com/shawnliu/archive/2007/12/11/991261.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
目 录 1 AnkhSVN 概述4 2 背景知识5 2.1 什么是 AnkSVN? 5 2.2 什么是版本库浏览器?5 2.3 什么是工作拷贝浏览器?6 2.4 什么是未提交更改视图(the Pending Changes view)7 2.4.1 什么是本地文件更改视图(Local File Changes view) 8 2.4.2 什么是问题视图(the Issues view)8 2.4.3 什么是最近修改视图?9 2.4.4 什么是冲突合并视图 10 3 开始使用 AnkhSvn10 3.1 安装 AnkhSVN 10 3.2 在 VisualStudio 中启用 AnkhSvn 10 3.3 将项目连接到 AnkhSVN 11 3.4 增加解决方案到版本库 12 3.5 浏览版本库13 3.6 增加工作拷贝到工作拷贝浏览器 14 4 版本控制操作14 4.1 签出解决方案14 4.1.1 从 Subversion 打开解决方案 15 4.1.2 从版本库浏览器中签出 15 4.2 更新你的工作拷贝16 4.3 在 Pending Changes 中执行 Subversion 操作 16 4.4 提交修改17 4.4.1 提交你的修改 17 4.4.2 签入一个新项 18 4.5 获得和释放锁18 4.5.1 锁定一个项19 4.5.2 释放锁19 4.6 修改取消20 4.7 回滚一个项到特定的版本 20 4.8 查找什么人对其中的一行进行了修改 21 4.9 分支、标记和合并22 4.9.1 创建一个分支或者标记 22 4.9.2 切换到分支23 4.9.3 合并更改24 4.10 比较不同25 4.11 查看版本历史27 4.12 创建和应用补丁(patches) 28 4.12.1 创建一个补丁 28 4.12.2 应用补丁29 4.13 将项增加到更改列表中 29 4.14 增加一个 Subversion 属性 30 4.15 清理工作拷贝31 4.16 集成 issue tracker32 4.16.1 连接到 issue tracker32 4.16.2 将问题关联到一个 Commit 32 4.16.3 当提交提交时更新问题的状态 33 4.16.4 在查看历史时打开一个问题 33 4.17 配置和外部工具34 附件 1、AnkhSVN 图标样例表 35 附件 2、Overview of CollabNet Merge Client 36 附件 3、Creating and Applying Patches 47 附件 4、Changelists 50 1 AnkhSVN 概述 AnkhSVN 为 VisualStudio 提供的一个 Subversion 源码控制插件。通过该 IDE 工具,你 可以在 VisualStudio 中直接进行大部分版本控制操作。 你可以在 AnkhSVN project on .下载 AnkhSvn 的 Release 版本以及日常开 发版。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值