SVN上的常见问题

来源:互联网 发布:局域网禁止上网软件 编辑:程序博客网 时间:2024/04/27 22:38

>>1.svn is already under version control问题解决

 svn ci 时出现 xx is already under version control,然后无法提交,出现这个问题的原因是你所提交的文件或目录是其他SVN的东西,即下面有.svn的目录,需要先把它们删除才能提交,具体操作如下:

打开terminal,cd到你新增加的那个目录,然后用下面的命令

#find . -mindepth 2 -name '.svn' -exec rm -rf '{}' \;

这个命令会递归的删除目录下所有.svn的文件夹,现在,再提交一次试试?

上面写的可能不好理解,其实很简单,直接打开你所用的MyEclipse对应的workspace,找到相应的项目,进而找到你提交不上去的那个目录,把这个目录下的.svn文件删除即可。

 

>>2.svn:Item is out of date

svn: Item is out of date

    使用Svn提交时候遇到如下错误:

    Deleting       E:/bdf-d7/bdf-dorado7/src/com/bstek/bdf/d7/cms/dir
    Item is out of date
svn: Commit failed (details follow):
svn: Item '/trunk/bdf-dorado7/src/com/bstek/bdf/d7/cms/dir' is out of date

遇到这个错误原因是本地的资源文件版本不是服务器上面最新的版本,因此修改本地文件再提交时候,就会报Out of date错误。

解决办法,修改文件时候一定要首先保证和服务器一致,再做修改;而此时 需要先将本地文件还原(记着备份哦),再更新和服务器一致后再做修改。

http://stackoverflow.com/questions/2805546/svn-item-folder-is-out-of-date

Whenever you see "out of date" in an error message it means that the revision of the item in the repository is newer than the copy in your local working copy.
The solution is always going to be to run an update, so that your working copy is up to date with the repository, and then do the commit again (assuming that the update did not generate any conflicts).

For files, this is usually pretty easy to understand how and why this happens. However, Subversion also versions folders, and it is usually with folders that this problem most often happens.
Subversion does not allow you to delete/rename a folder OR change its versioned properties, UNLESS the local copy of the folder is at the HEAD revision of the folder in the repository.

Your next question might be:
"OK, I can maybe understand that, but why is my folder out of date? I am the only person working in this repository."

That is a valid question, the answer lies in the way that Subversion works.
When you commit a change to a file, the revision of the file in your working copy is updated to that new revision when the commit completes, however the version of the parent folder(s) of that file is not updated.
This is because there may have been adds/deletes to other files in that folder and until you have run an update, the folder is not really at that new revision.
This is called "mixed revision working copies".

In summary, the answer is always to do an update so that the folder or file is updated to itsHEAD revision.

 

>>3.svn上操作出错问题总结:

svn上修改后不能改名称,更新后再改
出错一般的解决方法就是本地和服务器不同步,先更新,然后再操作,这样就没问题了。

 

>>4.删除svn版本信息.svn文件夹

学习笔记:删除SVN版本信息的两种方式

                  2010-06-01 18:35 chendang1314 csdn.net

在学习SVN的过程中,你可能会遇到SVN的删除问题,本文主要介绍一下如何在Linux和Windows两种操作系统中删除SVN版本信息,希望对你的学习有所帮助。

AD:

本节主要介绍一下删除SVN版本信息方面的知识,在实际运用中经常会遇到此类问题,就该问题该如何解决和大家讨论一下,欢迎大家一起来学习删除SVN版本信息方法。
删除SVN版本信息
问题:从公司svn下,检出代码,包含svn信息,它是可以同步的包括很多的svn信息。但是我要这些代码只是看看,并在利用它在本地svn服务器上,且往往包含这些svn版本信息的文件占空间,拷贝速度慢。
解决:
1、在公司svn上再 导出一份
    导出和检出是不同的,导出不包含版本信息,检出则包含版本信息
2、因为代码比较多,有2G多,导出比较慢
   本地拷贝一份含svn版本信息的文件,想办法删除所有版本信息。
最简单的方法是,搜索所有.svn文件,然后删除。查了哈网上的,有两个方法如下:

一、在linux下删除SVN版本信息

删除这些目录是很简单的,命令如下
find . -type d -name ".svn"|xargs rm -rf
或者
find . -type d -iname ".svn" -exec rm -rf {} \;  

全部搞定。(http://tech.techweb.com.cn/redirect.php?fid=26&tid=205673&goto=nextnewset)

二、在windows删除SVN版本信息下用以下法子:

1、在项目平级的目录,执行dos命令:
xcopy project_dir project_dir_1 /s /i

2、或者在项目根目录执行以下dos命令
for /r . %%a in (.) do @if exist "%%a\.svn" rd /s /q "%%a\.svn"

其实第二种方法可以用来干很多事的,比如把代码中的.svn替换为任意其他文件名并在硬盘根目录下执行,就可以从硬盘上删除所有的这个文件啦。

3、加注册表

Jon Galloway提供了一段注册表代码,可以将”Delete SVN Folders”命名增加到资源管理器的右键上,这样,鼠标点两下就能把选中目录下的所有.svn目录干掉了。Works just great!

代码为:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
@="Delete SVN Folders"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
@="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" \""

将这段代码保存为一个.reg文件,双击确认导入注册表即可。 本文关于删除SVN版本信息介绍完毕。

 

----------------------------------------------------------------------------------------------------------------------------------------------

呵呵,我试了一下第三种——通过写注册表在资源管理器右键菜单中增加子菜单,效果非常棒!!!

 

>>5.SVN:cannot map the project with svn provider

用Eclipse导入项目的时候,会出现以下问题

SVN:cannot map the project with svn provider

解决办法

1、看工程目录下是否有相同的目录,有则删除。

2、删除.metadata/.plugins/org.tigris.subversion.subclipse.core目录下.svnProviderState文件。

重新启动elcipse,然后导入项目。

OK,问题解决。

 

注意两点:

.metadata目录在myeclipse工作目录下面

修改好后要重启myeclipse