• SVN专题(Visual SVN Server + TortoiseSVN + Visual SVN)


    参考资料:

    1、Windows环境下搭建SVN服务器。原文地址:https://blog.csdn.net/lu1024188315/article/details/74082227

    2、Git|SVN学习目录:https://blog.csdn.net/lu1024188315/article/details/74080006

    3、搭建SVN服务器详细教程:https://blog.csdn.net/daobantutu/article/details/60467185

    4、VisualSVN Server提交前必须写信息(备注):https://blog.csdn.net/zyf_balance/article/details/51332056

    5、svn 服务器设置,提交时强制注释(Windows版):https://blog.csdn.net/feihu_guest/article/details/39499063

    下载地址

    VisualSVN Server(免费)

    http://www.visualsvn.com/server/download/

    TortoiseSVN

    http://tortoisesvn.net/downloads.html

    Visual SVN(VS插件)

    Eclipse SVN插件

    官方下载: http://www.eclipse.org/subversive/downloads.php

    =======================================

    一、Visual的安装和使用

    1 VisualSVN Server安装

    【1 】几乎都是下一步。

    【2】 选择 visualVSN服务器和管理控制台 或只有管理控制权限

    【3】选择程序安装的路径、Subversion Repository(库)的路径和所使用的协议和端口。

    【4】接着就是复制文件的过程。

    【5】安装完成后会询问你是否需要运行VisualSVN Server Manager(一个非常有用的管理工具)

    【6 】打开“ VisualSVN Server Manager ”,如下:

    二、 创建版本库

    修改URL:

    查看IP命令:

    下面我示范添加一个代码库【Repository】,如下图:

    点击Repository右键

    按上图所示,创建新的代码库,在下图所示的文本框中输入代码库名称:

    【注】上图中的CheckBox如果选中,则在代码库StartKit下面会创建trunk、branches、tags三个子目录;不选中,则只创建空的代码库StartKit。

    点击OK按钮,代码库就创建成功了。

    创建完代码库后,没有任何内容在里面

    下面,我们开始安全性设置,在左侧的Users上点击右键:

    输入上面的信息,点击OK,我们就创建一个用户了。按照上面的过程,分别添加用户其他用户就可以了。

    下面我们开始添加这些用户到我们刚才创建的项目里。

    点击刚才创建的库,Lenovo,右击选择属性(Properties)

    点击上图中的"Add..."按钮,在下图中选择我们刚才添加的用户,

    注意这里的权限设置,要选择好。

    点击"确定"按钮,上面的用户就具有了访问StartKit代码库的不同权限。

    =======================================

    三、检出项目和上传代码

    3.1 检出项目(以lenovo项目为例)

    创建版本库lenovo,右键点击lenovo文件夹,选择copy URL toCLipboard,就是复制统一资源定位符(URL)到剪贴板中

    在电脑空白处单击右键,选择SVN检出(SVN Checkout...)

    之后弹出对话框,将刚出的地址粘贴到第一个地址栏中

    再选择导出目录,点击确定。会弹出输入用户名和密码的对话框,而且会在你选择的导出目录处新建一个lenovo文件夹。

    输入刚才创建的用户名和密码。确定,然后会弹出检出界面。

    =======================================

    3.2上传文件到SVN

    将要上传的文件放到导出目录中, 右键TortoriseSVN—Add,再右键提交

    选择后弹出提交对话框

    四、VisualSVN Server提交前必须写信息(备注)

    Visual SVN Server下 右键项目  “所有任务”》“Manage Hooks” 》选中Pre-commit hook然后edit编辑,添加如下代码

     @echo off

    ::    
    :: Stops commits that have empty log messages.
    ::

    @echo off

    setlocal
    rem Subversion sends through the path to the repository and transaction id
    set REPOS=%1
    set TXN=%2

    rem check for an empty log message
    svnlook log %REPOS% -t %TXN% | findstr . > nul
    if %errorlevel% gtr 0 (goto err) else exit 0

    :err
    echo. 1>&2
    echo 信息(备注)不允许为空,请填写信息然后重试 1>&2

    exit 1

     在SVN的Repositories路径中: RepositoriesRedAndGreenhooks     创建pre-commit.bat批处理文件,内容如下:

    @echo off
    rem SVN强制写注释的hooks脚本(Windows)
    rem 文件名是: pre-commit.bat,放到repository/hooks目录下
    setlocal
    set SVN_BINDIR="C:Program FilesVisualSVN Serverin"
    set REPOS=%1
    set TXN=%2

    rem check that logmessage contains at least 10 characters
    rem .....代表5个字符
    %SVN_BINDIR%svnlook log "%REPOS%" -t "%TXN%" | findstr ".........." > nul

    if %errorlevel% gtr 0 goto err
    exit 0

    :err
    echo [Commit failed]: Empty log message not allowed. 1>&2
    exit 1

    五、SVN常用操作

    一、由于Unity打包过程需要耗费很长的时间,在测试过程中如果只需测某几种功能,则我们大可以需要将某些Resources中的资源删除,以节约打包时间. 但是当你删除之后,问题来了,每次更新SVN都会把这些删除了的资源重新更新下来,再此编译,又要耗费很长时间。
     
    如果我们更新的时候能让SVN不更新这部分资源就好了,可惜的是TortoiseSVN就有这功能。
    将资源排除在SVN控制之内:
    右键单击文件夹 -> TortoiseSVN -> Unversion and add to ignore list -> 文件夹名称
     
    将资源重新纳入至SVN控制:
    如果你要重新纳入的文件已经在本地不存在,那么你可以从SVN上重新Checkout一份. 但重新Checkout下来的文件夹仍然没有纳入到SVN控制中。
    右键单击该文件夹 -> TortoiseSVN -> Clean up -> 在弹出的对话中统统都打勾 -> 再次Update 
     
    二、服务器换了新的IP地址,这时候我们之前下载下来的SVN项目就需要重新链接至最新的IP地址。
    解决步骤:

    重新定义SVN的URL,右键(TortoiseSVN) → Relocate → 输入你新的IP地址

    TortoiseSVN <wbr>(一) <wbr>- <wbr>疑难操作

    六、SVN常用图片及含义

    原文地址:http://blog.csdn.net/xh16319/article/details/10582455

    绿色的勾:图标表示这是一个最新取出的工作副本,他的Subversion状态是normal。

    灰色的勾:灰色图标表示”只读”,如果你给一个文件设置了svn:needs-lock属性,Subversion会让此文件只读,直到你获得文件锁。只读文件具有这个重载图标来表示你必须在编辑之前先得到一个锁。

    红色感叹号:当你开始编辑一个文件,这个文件的状态就会变成modified,图标也会变成红色圆圈带一个感叹号。这样你就可以轻易的知道自从上次更新以来都有修改过哪些文件,需要提交哪些文件。

    黄色感叹号:三角符号带感叹号,表示在一次update中产生了一个冲突(conflict)。

    蓝色加号:意味着这个文件或文件夹已经被计划加入到版本控制之下。

    红叉叉:表示相应文件或文件夹被计划删除(deleted),或者表示文件缺失。

    灰色一行:表示不受版本控制,忽略版本控制。

    蓝色问号:暂时还没收到版本的控制,但是没有被忽略。

    锁扣:表示文件被锁定,他的Subversion状态是normal,必须先释放锁才能让别人的更改提交。

    SVN图标无法正常显示问题解析:
    1.在Myeclipse或者Eclipse中使用SVN插件作为版本控制器,一直以来都是正常使用的。但是突然哟一天,project下的files的版本号和提示图标都不见了,经过检查SVN是正常的。
    开始的时候是把wrokspace下的.metadata删除,然后重新将project导入workspace下,即可正常使用。
    但是现在发现一种更为方便的方法:
    进入 到:windows->preferences->General->Appearance->LableDecorations勾选其中的SVN项即可。或者,还可以打开windows->preferences->Team->SVN中做相关设置。

    2.最近更新了SVN软件,更新后发现,同步文件夹没有打对勾的标记,网上都说检查SVN设置:
    右键->TSVN->设置->样式->重叠图标->Statuscache
    里面有三个选项:
    1Default
    2Shell
    3None
    如果是前面两个,应该就有svn图标,如果是none,就没有。
    但都解决不了问题,后来用安装文件的修复功能解决了此问题,即双击安装文件,选修复,之后重启系统就可以了。这似乎是SVN更新后的普遍问题。

    • 项目视图   The Package Explorer view

    - 已忽略版本控制的文件。可以通过Window → Preferences → Team → Ignored Resources.来忽略文件。
    A file ignored by version control. You can control what resources will be ignored by going to Window → Preferences → Team → Ignored Resources.

     - 未纳入版本控制的文件,一般是新增,尚未提交的文件。
    A file not under version control. These are typically new files that you have not committed to the repository yet.

    - 本地重命名或移动到其它目录的文件。
    A versioned file that needs to be added to the remote repository. These are typically files you have either renamed, or moved to a different directory.

    - 本地删除的目录。
    A deleted folder. These are folders that you have deleted locally without yet committing the changes to the repository. Note that files are usually removed from the view when they're deleted locally, so they are normally not seen with this icon.

    - 没有任何改动的文件。
    A file with no local changes.

    - 发生改动,尚未提交的文件。
    A file with local, uncommitted changes.

    - 处于锁定状态的文件。
    A locked file.

    - 有冲突没有解决,就更新或提交的文件。
    A conflicted file. These are typically files that had a commit/update conflict that you marked to resolve later.

     - 有目录树冲突的文件。一般在最近一次更新后,资源库上的文件被移动、删除或重命名。
    A file that has a tree conflict. These are typically files that have local changes, but have since been moved, removed, or renamed in the repository since the last local copy update.

    -  引用外部项目的文件,不能提交到本项目的资源库里。
    A file that is external to the project. Linked external files cannot be committed to the repository.

    - 有分支版本的文件。这些文件属于另外一个不同的工作目录而不是属于本地的父目录。
    A file that has been switched. These are files which belongs to a different working copy than their local parent directory.

    • 迁出 Outgoing view

    - 本地有更改的文件。
    A file whose contents have been modified and will be committed to the repository.

    - 本地新增的文件。
     A file that will be newly added to the repository. This may coincide with a file removal in cases where a file is moved or renamed..

    - 本地删除的文件。
    A file that will be removed from the repository. This may coincide with a file addition in cases where a file is moved or renamed.

    - 本地文件属性发生变化了的文件。
    A file with property changes, in the Commit dialog. On the Synchronize tab, property changes are currently reflected as a normal file modification ().

    • 迁入 Incoming view

    - 需要更新的文件。 
    A file that has content changes committed to the repository that will be applied to the local copy.

    - 需要迁入的新增文件。
    A new file that will be added to the local copy from the repository. Like the outgoing file addition, this may be the result of a move or rename.

    - 资源库中删除了的文件。
    A file that will be removed from the local copy because it has been removed from the repository. Like the outgoing file removal, this may be the result of a move or rename.

    • 冲突 Conflict view

    - 资源库和本地同时有修改的文件。
    A file that has been changed in both the local copy and repository independently, causing a need for conflict resolution. Fixing this condition involves opening up the conflict view or forcibly overwriting changes locally or remotely.

    - 远程资源库上已经被重命名或移动、删除的文件。 
    A file that has a tree conflict. This can occur when there are new changes to a file on one end (either local or remote), and the file is moved, removed, or renamed on the other.

    • “与资源库同步”选项打开的界面上的一些按钮 Others :

    Finally, the Synchronize with Repository option opens the Synchronize tab () with the following buttons:
     
    - 同步选中的文件,下拉箭头切换不同的远程目录。
    Synchronizes the local copy with the currently selected repository when clicked. Selecting from the drop-down allows switching between different remote code bases.

    - 只显示需要迁入的文件。

    Shows only incoming changes (remote → local).

     - 只显示需要提交的文件。

    Shows only outgoing changes (local → remote).

    - 同时显示需要更新或提交文件。

    Shows both incoming and outgoing changes (remote ↔ local).

    - 只显示有冲突的文件。

    Shows conflicting changes.

    - 更新全部文件。

    Updates all local resources with incoming changes after prompt.

    - 提交全部文件。

    Brings up the commit dialog to commit all outgoing changes.

    七、SVN常见问题及解决方法

    7.1svn状态图标不显示

    Windows最多只允许15个覆盖图标,它自己又用了几个,结果给用户用的就11个左右了,如果你安装了其他网盘,那可用的就更少了。

    解决方法:

    1、在运行里输入regedit进入注册表

    2、依次打开HKEY_LOCAL_MACHINE->SOFTWARE->Microsoft->Windows->CurrentVersion->Explorer->ShellIconOverlayIdentifiers,会发现Tortoise前缀的一些文件,选中右键重命名,在前面加个空格就可以排到最前面了,如下图:

    3、这时图标还是没有出来,需要重启下explorer.exe进程,在任务管理器的进程里找到explorer.exe,结束进程,然后 文件>新建任务(运行...),输入explorer.exe,图标就会显示出来了,如下图:

    7.2、svn报错can only be performed on a version resource [at this time].

    https://www.cnblogs.com/pangguoming/p/7298749.html

    7.3、svn:Checksum mismatch while updating

    https://blog.csdn.net/a342500329a/article/details/73106267

    7.4、eclipse中svn提交显示错误svn: E200007: CHECKOUT can only be performed on a version resource

    https://blog.csdn.net/u011476390/article/details/78623572

  • 相关阅读:
    Go
    list的基本操作实现
    天梯赛练习题L2-006. 树的遍历
    部署 Fluent Bit ( td-agent-bit )
    elastalert + supervisor
    elastalert搭建
    Docker 部署 kibana( ES开启了密码认证)
    Docker 部署 elasticsearch( ES开启了密码认证)
    Python yaml模块
    Python json和pickle模块
  • 原文地址:https://www.cnblogs.com/cheng2015/p/9022829.html
Copyright © 2020-2023  润新知