SVN - 不是工作副本错误
我正在为这件事抓狂。
我有一个使用 Subversion 进行版本控制的网站。 我使用 aptana (eclipse, subclipse) 来做 svn。 我一直在签入和签出文件、更新等,一切都很好。 然而,我们一直在构建的系统一直在添加自己的文件和文件夹。
当我尝试提交这些时,它告诉我
不是工作副本。 如果我尝试进行清理,则会出现相同的错误。 我发现我可以手动将每个文件添加到版本控制中,但这会引发相同的错误。 进行更新没有帮助,刷新工作区也没有任何作用。 错误后清理似乎停止,然后目录被锁定。
我知道您应该使用 SVN 添加文件,但是您到底如何处理生成的文件呢? 如何解决此“
不是工作副本目录”错误? 如何让 Subversion 只查看文件并将它们添加到其存储库中?
I'm pulling my hair out on this one.
I have a site which is version controlled using Subversion. I use aptana (eclipse, subclipse) to do the svn. I have been checking in and out files, updating etc and everything is fine. However the system we have been building has been adding its own files and folders.
When I try to commit these, it tells me <path>
is not a working copy. If I try to do a cleanup then it gives the same error. I found I can manually add each file to version control but this throws the same error. Doing an update doesn't help, refreshing the workspace does not do anything either. Cleanup seems to die after the error and then the directory is locked.
I know you're supposed to add files using SVN, but how on earth do you work with generated files? How do I get around this "<folder>
is not a working copy directory" error? How do I get Subversion to just look at the files and add them to its repository?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
今天,当我尝试添加一个没有写入权限的文件夹“A”时,我们遇到了这个问题(因此无法创建 A/.svn 文件夹)。
运行 svn status 在文件夹 A 旁边显示了一个“~”。
运行 svn cleanup 说 A 的父级被锁定。
最终起作用的是:
We had this problem today when I tried to add a folder "A" in which I didn't have write permission (so it couldn't create the A/.svn folder).
Running svn status gave me a "~" next to folder A.
Running svn cleanup said that parent of A was locked.
What ended up working was:
如果您希望将生成的文件添加到 SVN,请使用 svn add 递归添加它们 - 这将确保所有目录都是工作副本的一部分,并且所有文件和目录都添加到 SVN ,并将作为下一次 svn 提交的一部分提交。
但是,通常生成的文件和文件夹不应添加到 SVN,因为它们是作为构建的一部分从源文件生成的。 在这种情况下,您应该使用 svn 进行标记:忽略,这样它们就不是工作副本的一部分。
If you want the generated files to be added to SVN, use
svn add
to recursively add them - this will make sure that all directories are part of the working copy, and all files and directories are added to SVN, and will be committed as part of the nextsvn commit
.However, often generated files and folders should not be added to SVN, since they are generated from the source files as part of a build. In this case, you should mark the with svn:ignore so that they are not part of the working copy.
不是工作副本错误表示当前文件夹尚未被SVN正确初始化。
要修复该错误,只需重命名当前文件夹,然后通过对项目进行检出,从 SVN 获取项目的正确工作副本。
然后签出将创建该项目的正确配置的工作副本。
The not a working copy error means that the current folder has not been correctly initialised by SVN.
To fix the error just rename the current folder and then get a proper working copy of the project from SVN by doing a checkout of the project.
The check out will then create a properly configured working copy of that project.
我刚刚在我的工作副本中遇到了“不是工作副本”错误。 这是一个 JDeveloper 项目,结果发现我刚刚安装的 JDeveloper 升级 (11.1.1.2.0) 包含了比我用于命令行 SVN 访问 (jsvn) 的版本更高的 SVNKit。 因此,JDeveloper 悄悄升级了 .svn 文件的格式,这意味着命令行客户端无法理解它们。
当 jsvn 抱怨我的项目顶级目录中缺少文件“.svn/format”时,我的心情就大跌眼镜了。 我在子文件夹中发现了一堆这样的文件,它们看起来都一样,只包含数字“9”。 因此,我将一个复制到顶级文件夹中,然后 jsvn 最后给出了一条适当的消息:“svn:此客户端太旧,无法使用工作副本 '.';请获取更新的 Subversion 客户端”。
一旦我(通过 Google)识别并安装了兼容的客户端 SVNKit 级别,新改进的 jsvn 就能够识别出我的工作副本实际上是工作副本。
故事的寓意:如果您收到此错误,并且您在同一台计算机上使用不同的 SVN 客户端,则问题可能是它们不同步。
I just encountered the "not a working copy" error in my, ahem, working copy. This was for a JDeveloper project and it turned out that the JDeveloper upgrade (11.1.1.2.0) that I'd just installed incorporated a later version of SVNKit than the one I use for command-line SVN access (jsvn). So JDeveloper had quietly upgraded the format of the .svn files, which meant that the command-line client couldn't understand them.
The penny dropped when jsvn complained about a missing file ".svn/format" in my project's top-level directory. I found heaps of these in subfolders, all looking identical and containing only the digit "9". So I copied one into the top-level folder and jsvn then finally gave an appropriate message: "svn: This client is too old to work with working copy '.'; please get a newer Subversion client".
Once I had identified (via Google) and installed the compatible client SVNKit level, the new improved jsvn was able to recognise that my working copy IS in fact a working copy.
Moral of story: if you get this error and you're using different SVN clients on the same machine, the problem may be that they've got out of sync.
现在使用 TortoiseSVN 清理一些死目录时遇到了这个问题。 我对文件进行了备份,然后使用代表浏览器删除了有问题的目录(无论如何,它已经消失了)。 然后项目的清理工作开始工作,我现在可以继续处理当前的文件。
Ran into this now using TortoiseSVN cleaning up some dead directories. I made a backup of the files and then used the rep browser to delete the faulty dir (which was a goner anyways). Then cleanup on the project worked and I can now keep going with my current files.
请尝试找出问题所在。 这是丢失的 .svn 文件还是其他文件?
请记住,.svn 文件是在您完成签入后创建的。 并包含相应的目录路径、带有唯一编号标记的代码名称。
转到您认为已完美签入的项目的基本路径。
创建一个新的临时包并在该路径中添加示例 java 代码。
添加到版本并尝试提交。
如果出现错误提示文件夹已锁定(尝试锁定已锁定的文件夹),请转到 .svn 文件夹并重命名锁定文件。
再次尝试签入并提交
如果工作正常,那么您就完成了。
使用相同的基本目录,并在清理后再次从该目录签入您的代码到您的文件夹级别。
Please try to find out where the problem is . Is this the missing .svn file or something else.
Remember .svn file is created when you are done with your checkin. and contains the corresponding directory path, code names with a unique number tagged to them.
Go to the base path of your project you think is checked in perfectly.
Create a new temporary package and added a sample java code in that path.
Add to the version and try to commit.
If you get an error saying that the folder is locked(Attempting to lock the already locked folder), then go the .svn folder and rename the lock file.
Try again to checkin and commit
If it works fine, then you are done.
Use the same base directory and checkin your code again onwards from that directory to your folder level after cleaing up.
“不是工作副本”意味着 IDE 尝试运行 svn 的位置之一不受 svn 本身控制(例如在子目录中添加文件)不在
svn
下)。 我建议检查 IDE 中的路径。"Not a working copy" means that one of the places where your IDE is trying to run
svn
into is not controlled bysvn
itself (like adding files in a sub-directory not undersvn
). I'd say check your paths within the IDE.因为我使用可视化工具完成每项任务,所以我无法告诉您需要执行哪些命令。
这是我的环境,Windows XP。 tortoiseSVN 1.6.7 与 Subversion 1.6.9,Eclipse 3.5 与 Subclipse 1.6.10。 存储库通过 Windows 上的可视化 SVN 服务器进行管理。
希望这可以帮助。
Because I do every tasks with visual tools, I can´t tell you what commands need to be executed.
This is my environment, Windows XP. tortoiseSVN 1.6.7 with Subversion 1.6.9, Eclipse 3.5 with Subclipse 1.6.10. and the repository is managed with visual SVN server over windows.
Hope this helps.
就我而言,我将 Eclipse 工作区位置移动到另一个位置,然后出现问题。 为了解决问题,我从 svn 存储库中签出项目。 然后在旧项目中我清理所有 svn 文件。 (简单搜索 .svn 并删除)然后我将内容复制到刚刚签出的内容中,我的更改变得可见,并且我的项目是最新的。 此方法可应用于其他烦人的错误。 希望能帮助某人
in my case I move eclipse workspace place to another then problem is occured. For solving problem I checkout project form the svn repo. Then in old project I clean all svn files. (simple search .svn and delete ) then I copy the content to the just checkedout one my changes become visible and my project is up to date. This method can be applied for other annoying errors. Hope help someone
请将当前目录
移动
到另一个位置,并执行svn update
命令,然后用移动的目录替换目录如果使用 tortoisteSVN,您可以在运行 svn update 之前,运行 cleanup 你的根目录
please
move
current directory in another location, and executesvn update
command , then replace directory with moved directoryif use
tortoisteSVN
, you can before run svn update , run cleanup you root directory