“Phantom” directories in an SVN repository

后端 未结 7 2478
没有蜡笔的小新
没有蜡笔的小新 2021-02-18 18:13

I\'ve somehow managed to get an SVN repository into a bad state. I\'ve moved a directory and now I can\'t commit it in its new location.

As far as svn status

相关标签:
7条回答
  • 2021-02-18 18:27

    The easy way to fix many SVN errors is to move the whole directory away via the OS, update to get another clean copy of it and then merge in anything you changed with some other tool, WinMerge or the like.

    After that, you can do whatever you were trying to do, but do it correctly :).

    0 讨论(0)
  • 2021-02-18 18:32

    My experience is that sometimes the local copy gets out of sync with the repository. I usually solve this by going up the local directory tree, starting from the directory with the problem and try to do do cleanup and update with each step.

    0 讨论(0)
  • 2021-02-18 18:34

    I'd suggest, to delete (outside subversionso with rm or similar), the directory above test, and then running svn update there.

    That is, if you don't want to get a whole new working copy as others have suggested, which might be the safest approach.

    0 讨论(0)
  • 2021-02-18 18:40

    Did you start by just copying/moving the directory with OS commands, or did you start with SVN stuff? If you just copied the files via the OS, you would still have hidden folders containing SVN information pointing to the old location.

    0 讨论(0)
  • 2021-02-18 18:42

    I just had this same problem. I fixed it by deleting the .svn folder from the affected folder.

    0 讨论(0)
  • 2021-02-18 18:47

    What happened is that you made a checkout of a folder, then locally 'svn add'ed and/or modified something to/in this folder, but before you have committed your changes, the original folder was moved (or deleted) from the SVN repository.

    All you need to do is to switch your current checkout to the new location in the SVN repository. So, supposing you have a checkout of the foo folder from path/to/folder1/foo, and that foo was moved to path/to/foo, you just need to run:

    $ svn switch path/to/foo
    

    That's it... ;-)

    0 讨论(0)
提交回复
热议问题