subversion - 接收错误“已经是不同 URL 的工作副本”

subversion - 接收错误“已经是不同 URL 的工作副本”

当我签出项目或尝试提交(我以前可以这样做)时,我收到以下错误:

svn: 'C:\Users\username\workspace\ABC' is already a working copy for a different URL

其中 ABC 是项目名称。您有想法如何修复这个问题或者是什么原因导致的?

答案1

您的working directory包含.svn指向某些存储库的子目录,请使用以下命令采取下一步措施来解决您的问题:(infostatusresolve):

  • svn info- info:显示有关本地或远程项目的信息。
  • svn status- status (stat,st):打印工作副本文件和目录的状态。
  • svn resolve- 解决:解决工作副本文件或目录的冲突。

答案2

我参加这个聚会已经很晚了,但遇到了同样的问题。我刚刚从较旧的 svn 版本迁移到较新的版本和较新的服务器。本地工作目录仍然指向旧服务器。svn 重新定位命令修复了该问题。参见:

D:\dev\svn_monitor>svn help relocate
relocate: Relocate the working copy to point to a different repository root URL.
usage: 1. relocate FROM-PREFIX TO-PREFIX [PATH...]
       2. relocate TO-URL [PATH]

  Rewrite working copy URL metadata to reflect a syntactic change only.
  This is used when a repository's root URL changes (such as a scheme
  or hostname change) but your working copy still reflects the same
  directory within the same repository.

  1. FROM-PREFIX and TO-PREFIX are initial substrings of the working
     copy's current and new URLs, respectively.  (You may specify the
     complete old and new URLs if you wish.)  Use 'svn info' to determine
     the current working copy URL.

  2. TO-URL is the (complete) new repository URL to use for PATH.

  Examples:
    svn relocate http:// svn:// project1 project2
    svn relocate http://www.example.com/repo/project \
                 svn://svn.example.com/repo/project

Valid options:
  --ignore-externals       : ignore externals definitions

Global options:
  --username ARG           : specify a username ARG
  --password ARG           : specify a password ARG (caution: on many operating
                             systems, other users will be able to see this)
  --password-from-stdin    : read password from stdin
  --no-auth-cache          : do not cache authentication tokens
  --non-interactive        : do no interactive prompting (default is to prompt
                             only if standard input is a terminal device)
  --force-interactive      : do interactive prompting even if standard input
                             is not a terminal device
  --trust-server-cert      : deprecated; same as
                             --trust-server-cert-failures=unknown-ca
  --trust-server-cert-failures ARG : with --non-interactive, accept SSL server
                             certificates with failures; ARG is comma-separated
                             list of 'unknown-ca' (Unknown Authority),
                             'cn-mismatch' (Hostname mismatch), 'expired'
                             (Expired certificate), 'not-yet-valid' (Not yet
                             valid certificate) and 'other' (all other not
                             separately classified certificate errors).
  --config-dir ARG         : read user configuration files from directory ARG
  --config-option ARG      : set user configuration option in the format:
                                 FILE:SECTION:OPTION=[VALUE]
                             For example:
                                 servers:global:http-library=serf

答案3

当我删除本地 WD 并尝试再次签出时,我遇到了类似的问题。请务必提供 SVN 目录的准确路径,因为还会有其他包含 .svn 文件的目录,因此会发生冲突。

答案4

这肯定会有所帮助:

  • 从系统中删除所有 .svn 目录(您可能需要创建备份)
  • 对存储库进行新的签出

您可能需要使用以下 DOS 命令来查找 .svn 目录:

cd \
dir /s .svn

相关内容