本文翻译自:How to resolve “local edit, incoming delete upon update” message
When I do a svn status .
当我做一个svn status .
, I get this: ,我明白了:
! C auto-complete-config.elc
> local edit, incoming delete upon update
! + C auto-complete.elc
> local edit, incoming delete upon update
! + C popup.elc
> local edit, incoming delete upon update
! + C fuzzy.elc
> local edit, incoming delete upon update
basically, these files shouldn't be in the repository. 基本上,这些文件不应该在存储库中。 A developer has removed them. 开发人员已将其删除。 Then, I think I did a svn rm ...
after the fact by mistake (should've done svn update .
instead). 然后,我认为我做了一个svn rm ...
之后错误的事实(应该已经完成了svn update .
)。
So now, when I do svn status .
所以现在,当我做svn status .
, I get these tree conflict messages. ,我得到这些树冲突消息。
I found the doc here but not sure how to “merge” it according to the doc. 我在这里找到了doc但不确定如何根据doc“合并”它。
How to get rid of them? 如何摆脱它们?
I think my working copy is in sync with the repository. 我认为我的工作副本与存储库同步。 Don't know why these messages shows. 不知道为什么这些消息会显示出来。 These files should be removed and are removed as far as I know everywhere. 据我所知,这些文件应该删除并删除。 I tried svn update .
我试过svn update .
and svn revert .
和svn revert .
but I still get this message when I do svn status .
但是当我做svn status .
时,我仍然会收到此消息svn status .
. 。
#1楼
参考:https://stackoom.com/question/I7Ij/如何解决-本地编辑-更新时传入删除-消息
#2楼
So you can just revert the file that you deleted but remember, If you are working on any type of project with a set project file (like iOS), reverting the file will add it to your system folder structure but not your project file structure. 因此,您只需还原已删除的文件,但请记住,如果您正在使用设置项目文件(如iOS)处理任何类型的项目,则还原文件会将其添加到系统文件夹结构中,但不会添加到项目文件结构中。 additional steps may be required if you are in this case 如果你是这种情况,可能需要额外的步骤
#3楼
尝试使用解决冲突
svn resolve --accept=working PATH
#4楼
Short version: 精简版:
$ svn st
! + C foo
> local edit, incoming delete upon update
! + C bar
> local edit, incoming delete upon update
$ touch foo bar
$ svn revert foo bar
$ rm foo bar
If the conflict is about directories instead of files then replace touch
with mkdir
and rm
with rm -r
. 如果冲突是有关目录,而不是文件然后更换touch
用mkdir
和rm
与rm -r
。
Note: the same procedure also work for the following situation: 注意:相同的过程也适用于以下情况:
$ svn st
! C foo
> local delete, incoming delete upon update
! C bar
> local delete, incoming delete upon update
Long version: 长版:
This happens when you edit a file while someone else deleted the file and commited first. 当您在其他人删除文件并首先提交时编辑文件时会发生这种情况。 As a good svn citizen you do an update before a commit. 作为一名优秀的svn公民,您可以在提交之前进行更新。 Now you have a conflict. 现在你发生了冲突。 Realising that deleting the file is the right thing to do you delete the file from your working copy. 意识到删除文件是正确的做法,您从工作副本中删除该文件。 Instead of being content svn now complains that the local files are missing and that there is a conflicting update which ultimately wants to see the files deleted. 而不是内容svn现在抱怨本地文件丢失,并且存在冲突的更新,最终希望看到文件被删除。 Good job svn. 干得好svn。
Should svn resolve
not work, for whatever reason, you can do the following: 如果svn resolve
不起作用,无论出于何种原因,您可以执行以下操作:
Initial situation: Local files are missing, update is conflicting. 初始情况:缺少本地文件,更新存在冲突。
$ svn st
! + C foo
> local edit, incoming delete upon update
! + C bar
> local edit, incoming delete upon update
Recreate the conflicting files: 重新创建冲突的文件:
$ touch foo bar
If the conflict is about directories then replace touch
with mkdir
. 如果冲突与目录有关,则用mkdir
替换touch
。
New situation: Local files to be added to the repository (yeah right, svn, whatever you say), update still conflicting. 新情况:要添加到存储库的本地文件(是的,svn,无论你说什么),更新仍然存在冲突。
$ svn st
A + C foo
> local edit, incoming delete upon update
A + C bar
> local edit, incoming delete upon update
Revert the files to the state svn likes them (that means deleted): 将文件恢复到svn喜欢它们的状态(这意味着删除):
$ svn revert foo bar
New situation: Local files not known to svn, update no longer conflicting. 新情况:svn不知道本地文件,更新不再冲突。
$ svn st
? foo
? bar
Now we can delete the files: 现在我们可以删除文件:
$ rm foo bar
If the conflict is about directories then replace rm
with rm -r
. 如果冲突是关于目录,那么用rm -r
替换rm
。
svn no longer complains: svn不再抱怨:
$ svn st
Done. 完成。
#5楼
If you haven't made any changes inside the conflicted directory, you can also rm -rf conflicts_in_here/
and then svn up
. 如果您没有在冲突的目录中进行任何更改,您还可以rm -rf conflicts_in_here/
然后svn up
。 This worked for me at least. 这至少对我有用。
#6楼
您可以强制将本地目录还原为svn。
svn revert -R your_local_path