svn檔案丟失的解法

來源:互聯網
上載者:User

轉自:http://triopter.com/archive/resolving-local-delete-incoming-delete-upon-update-subversion-tree-conflicts/

 

NOTE: I’ve noticed a lot of traffic to this page for “local
edit incoming delete on update” errors, which are not what this article
is about (the solution below may or may not work for that — I have no
idea). This article is about “local delete
, incoming delete on
update” errors. Always back up your work before you muck around with
something like this, but that goes doubly if you’re going to try to use
these instructions for the “local edit” error.

For reason I’m still trying to untangle, I encountered some really
terrible conflicts this afternoon with an SVN checkin that didn’t
complete properly, leaving me with a few locked directories that
wouldn’t respond to “svn cleanup”.

Using these instructions
, I was able to get the
directories sorted out:

  1. Move offending directories out of working copy and to a safe place
    (e.g. desktop)
  2. Run svn cleanup
  3. Run svn up

This actually restored the messed-up directories. Some files were
reverted and some deleted files restored; once the entire working copy
is cleaned up, you can use the backup copies of the directories to copy
back in your changes.

But before I could do that, I was left with a half-dozen individual
file conflicts with the following messages:


$ svn st
? C some_file.php
> local delete, incoming delete upon update
? C some_other_file.php
> local delete, incoming delete upon update
... etc.

Thankfully, these were files that I did
want to delete, so
even without instructions I wasn’t afraid to trial-and-error my way to
the following fix:


$ touch some_file.php some_other_file.php
$ svn revert some_file.php some_other_file.php

Once you’ve created the files, SVN can revert them, which leaves them
in unversioned status:


$ svn st
? some_file.php
? some_other_file.php

And then you can just delete them from the command line or whatever
file manager you use.

*Phew*

Once that was done I redid some deletions that had been overwritten
by the update that cleaned up the directories, and all was right in the
world.

Usual disclaimers, YMMV, etc.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.