在提交时,在乌龟svn中工作副本锁定错误。

时间:2023-01-30 16:27:34

I'm using Tortoise SVN to update and commit changes to the repository in the server whenever I make changes to my working copy. But from a few days I'm not able to commit the changes and I get the following error whenever I try to commit.

每当我对工作副本进行修改时,我都在使用乌龟SVN来更新和提交服务器上的存储库。但是,从几天开始,我就不能提交更改了,每次我尝试提交时,都会遇到以下错误。

Working copy 'C:\Program Files\EasyPHP\www\project\php' locked.
'C:\Program Files\EasyPHP\www\project' is already locked.

I've tried to unlock the folder by right clicking on it and selecting Tortoise SVN > Release lock, it says

我试着通过右键点击它并选择乌龟SVN >释放锁来解锁这个文件夹。

There's nothing to unlock. No file has a lock in this working copy

没有什么可解锁。在这个工作副本中没有文件有锁。

What might be the problem?

有什么问题吗?

9 个解决方案

#1


218  

No problem... try this:

没有问题…试试这个:

  • Go to top level SVN folder.
  • 进入*SVN文件夹。
  • Right click on folder (that has your svn files) > TortoiseSVN > CleanUp
  • 右键单击文件夹(它有您的svn文件)>玳瑁>清理。

This will surely solve your problem. I did this lots of time... :)

这肯定能解决你的问题。我花了很多时间……:)

Note. Make sure "Break locks" option is selected in the Cleanup dialog.

请注意。在“清除”对话框中选择“Break locks”选项。

#2


13  

The accepted answer didn't work for me. To fix that issue, I had to right-click on the file that was locked, select repo-browser. This opened a popup with the files as they are on the SVN server. I then right-clicked on the locked file and selected break lock.

这个公认的答案对我不起作用。为了解决这个问题,我必须右键单击锁定的文件,选择repo-browser。这打开了一个弹出的文件,因为它们是在SVN服务器上。然后右键单击锁定的文件并选择break lock。

When I closed the repository browser, back on explorer I could finally commit!

当我关闭存储库浏览器时,回到explorer,我终于可以提交了!

#3


11  

  1. Right click on folder.
  2. 右键点击文件夹。
  3. TortoiseSVN->Check for modifications.
  4. TortoiseSVN - >检查修改。
  5. Click on the Check repository button.
  6. 单击Check repository按钮。
  7. Break lock on all files returned.
  8. 打开所有返回的文件。

#4


3  

I ran into this issue as well. For some I would like to point out that if it is locked CHECK WITH YOUR TEAM. Someone on the team might have some things locked because they are working on it (this allows developers to do work on things without others coming in and trying to work on the same content as well). If that is the case, releasing the lock and then updating has the potential to lose data for the developer who locked it.

我也遇到了这个问题。对于一些人,我想指出的是,如果你的团队被锁定了。团队中的某个人可能会有一些东西被锁定,因为他们正在开发(这允许开发人员在没有其他人进入的情况下进行工作,并尝试在相同的内容上工作)。如果是这样,释放锁,然后更新就有可能丢失锁定它的开发人员的数据。

With that in mind my concern was that the "clean up" option would possibly change my working copy or remove information from the Repo level of Subversion. That is not the case. The answer worked for me. Mine became locked when I clicked cancel during the middle of an update. I ended up pulling some of our branches and I did not need the stuff so I hit cancel. My working copy became locked. I could not find any documents that came up as "locked" when I used the command 'release lock'. This left me puzzled and upon some quick reading (and this thread) I attempted the 'clean up' command. After a clean up it resolved my issue and nothing was locked anymore.

考虑到这一点,我担心的是“清理”选项可能会更改我的工作副本或从Subversion的Repo级别删除信息。事实并非如此。这个答案对我起作用了。当我在更新中点击取消时,我的锁就被锁定了。我最后拉了一些树枝,我不需要这些东西,所以我点击了取消。我的工作副本被锁上了。当我使用命令“释放锁”时,我找不到任何被“锁定”的文档。这让我感到困惑,在一些快速阅读(以及这个帖子)中,我尝试了“清理”命令。清理干净后,它解决了我的问题,再也没有锁住了。

source: http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-locking.html

来源:http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-locking.html

#5


2  

There are multiple meanings of "lock" in SVN and some of these answers that talk about "break lock" or a teammate holding a lock are not using the relevant meaning for the original question. This question is dealing with "working copy locks" (i.e. they are entirely local to the working copy on your computer and have nothing to do with you or teammates holding a lock/check-out on a file). The accepted answer by MicroEyes is referring to the correct usage and is your best option when this happens.

在SVN中有“lock”的多重含义,其中一些关于“break lock”的答案或者是一个持有锁的队友没有对最初的问题使用相关的含义。这个问题是处理“工作拷贝锁”(也就是说,它们完全是在你的计算机上的工作拷贝,与你或队友拿着锁/签出文件无关)。MicroEyes接受的答案是正确的用法,这是你最好的选择。

If a cleanup doesn't work you may need to check out a fresh working copy of the project. If you have any modified, un-commited files you will need to copy them over to the fresh working copy so you don't lose your changes.

如果清理工作不工作,您可能需要查看项目的新工作副本。如果您有任何修改过的、未提交的文件,您将需要将它们复制到新的工作副本中,这样您就不会丢失您的更改。

See this page in the Tortoise SVN docs for a description of the three usages of "lock": http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-locking.html

请参阅乌龟SVN文档中的这一页,描述“锁定”的三个用法:http://玳isesvn.net/docs/nightly/玳瑁。

Excerpt (emphasis added):

摘录(重点):

The Three Meanings of “Lock”

“锁”的三层含义

In this section, and almost everywhere in this book, the words “lock” and “locking” describe a mechanism for mutual exclusion between users to avoid *ing commits. Unfortunately, there are two other sorts of “lock” with which Subversion, and therefore this book, sometimes needs to be concerned.

在本节中,几乎在本书的每一个地方,“锁定”和“锁定”都描述了在用户之间相互排斥以避免冲突提交的机制。不幸的是,还有另外两种“锁定”,即Subversion,因此这本书有时需要关注。

The second is working copy locks, used internally by Subversion to prevent *es between multiple Subversion clients operating on the same working copy. Usually you get these locks whenever a command like update/commit/... is interrupted due to an error. These locks can be removed by running the cleanup command on the working copy, as described in the section called “Cleanup”.

第二个是工作复制锁,用于在内部使用Subversion来防止在同一工作副本上运行的多个Subversion客户机之间的冲突。通常,每当命令如update/commit/…由于错误而中断。可以通过在工作副本上运行清理命令来删除这些锁,正如在“清理”一节中所描述的那样。

...

#6


2  

I had no idea what file was having the lock so what I did to get out of this issue was:

我不知道这个锁有什么文件所以我从这个问题中得到的是:

  1. Went to the highest level folder
  2. 进入了*别的文件夹。
  3. Click clean-up and also ticked from the cleaning-up methods --> Break locks
  4. 点击清理,并从清理的方法——>断头锁上滴答滴答。

This worked for me.

这为我工作。

#7


1  

I had tried various things, including "Clean Up" on lower subdirectories. Finally, I tried updating the top level folder. Nothing. Then I read the "Clean up top level" tip. I tried that. The clean up part succeeded, but the lock remained. My solution was to go back to the top level, clean up, then clean up each red (!) folder I could drill down to. After all was "Cleaned up", the update worked perfectly. The "break lock" tip looks good, too, with the exception that someone on your team might have a legitimate lock on things.

我尝试过各种方法,包括在更低的子目录上“清理”。最后,我尝试更新顶层文件夹。什么都没有。然后我读了“清理顶层”的提示。我试过。清理部分成功了,但锁仍在。我的解决方案是回到顶层,清理干净,然后清理我可以钻到的每个红色(!)文件夹。在“清理完毕”之后,更新工作非常顺利。“断锁”提示看起来也很好,但是您的团队中的某些人可能拥有合法的锁。

#8


0  

I managed to lock myself out of a file in svn - don't know how - but when I tried (re)-getting the lock (Tortoise was showing the "Get Lock" option for the file), it complained that already had the lock. I tried deleting the file and committing the directory change - same result. I tried CleanUp (including refreshing the overlay), but that failed too.

我设法把自己锁在了svn的一个文件中——不知道是怎么回事——但是当我尝试(重新)得到锁的时候(乌龟正在显示文件的“Get lock”选项),它抱怨已经有了锁。我尝试删除文件并提交目录更改——同样的结果。我尝试过清理(包括刷新覆盖),但也失败了。

The solution was to go into the Tortoise repo-browser, find the file and use the break lock function.

解决方案是进入乌龟的repo-browser,找到文件并使用break lock函数。

#9


-1  

Windows Solution:

Windows的解决方案:

https://sourceforge.net/projects/win32svn/

https://sourceforge.net/projects/win32svn/

1.Download it, then add it to system path.

1。下载它,然后将它添加到系统路径。

2.Go to work directory execute "svn clean" and "svn update" in cmd.

2。在cmd中执行“svn clean”和“svn update”。

#1


218  

No problem... try this:

没有问题…试试这个:

  • Go to top level SVN folder.
  • 进入*SVN文件夹。
  • Right click on folder (that has your svn files) > TortoiseSVN > CleanUp
  • 右键单击文件夹(它有您的svn文件)>玳瑁>清理。

This will surely solve your problem. I did this lots of time... :)

这肯定能解决你的问题。我花了很多时间……:)

Note. Make sure "Break locks" option is selected in the Cleanup dialog.

请注意。在“清除”对话框中选择“Break locks”选项。

#2


13  

The accepted answer didn't work for me. To fix that issue, I had to right-click on the file that was locked, select repo-browser. This opened a popup with the files as they are on the SVN server. I then right-clicked on the locked file and selected break lock.

这个公认的答案对我不起作用。为了解决这个问题,我必须右键单击锁定的文件,选择repo-browser。这打开了一个弹出的文件,因为它们是在SVN服务器上。然后右键单击锁定的文件并选择break lock。

When I closed the repository browser, back on explorer I could finally commit!

当我关闭存储库浏览器时,回到explorer,我终于可以提交了!

#3


11  

  1. Right click on folder.
  2. 右键点击文件夹。
  3. TortoiseSVN->Check for modifications.
  4. TortoiseSVN - >检查修改。
  5. Click on the Check repository button.
  6. 单击Check repository按钮。
  7. Break lock on all files returned.
  8. 打开所有返回的文件。

#4


3  

I ran into this issue as well. For some I would like to point out that if it is locked CHECK WITH YOUR TEAM. Someone on the team might have some things locked because they are working on it (this allows developers to do work on things without others coming in and trying to work on the same content as well). If that is the case, releasing the lock and then updating has the potential to lose data for the developer who locked it.

我也遇到了这个问题。对于一些人,我想指出的是,如果你的团队被锁定了。团队中的某个人可能会有一些东西被锁定,因为他们正在开发(这允许开发人员在没有其他人进入的情况下进行工作,并尝试在相同的内容上工作)。如果是这样,释放锁,然后更新就有可能丢失锁定它的开发人员的数据。

With that in mind my concern was that the "clean up" option would possibly change my working copy or remove information from the Repo level of Subversion. That is not the case. The answer worked for me. Mine became locked when I clicked cancel during the middle of an update. I ended up pulling some of our branches and I did not need the stuff so I hit cancel. My working copy became locked. I could not find any documents that came up as "locked" when I used the command 'release lock'. This left me puzzled and upon some quick reading (and this thread) I attempted the 'clean up' command. After a clean up it resolved my issue and nothing was locked anymore.

考虑到这一点,我担心的是“清理”选项可能会更改我的工作副本或从Subversion的Repo级别删除信息。事实并非如此。这个答案对我起作用了。当我在更新中点击取消时,我的锁就被锁定了。我最后拉了一些树枝,我不需要这些东西,所以我点击了取消。我的工作副本被锁上了。当我使用命令“释放锁”时,我找不到任何被“锁定”的文档。这让我感到困惑,在一些快速阅读(以及这个帖子)中,我尝试了“清理”命令。清理干净后,它解决了我的问题,再也没有锁住了。

source: http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-locking.html

来源:http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-locking.html

#5


2  

There are multiple meanings of "lock" in SVN and some of these answers that talk about "break lock" or a teammate holding a lock are not using the relevant meaning for the original question. This question is dealing with "working copy locks" (i.e. they are entirely local to the working copy on your computer and have nothing to do with you or teammates holding a lock/check-out on a file). The accepted answer by MicroEyes is referring to the correct usage and is your best option when this happens.

在SVN中有“lock”的多重含义,其中一些关于“break lock”的答案或者是一个持有锁的队友没有对最初的问题使用相关的含义。这个问题是处理“工作拷贝锁”(也就是说,它们完全是在你的计算机上的工作拷贝,与你或队友拿着锁/签出文件无关)。MicroEyes接受的答案是正确的用法,这是你最好的选择。

If a cleanup doesn't work you may need to check out a fresh working copy of the project. If you have any modified, un-commited files you will need to copy them over to the fresh working copy so you don't lose your changes.

如果清理工作不工作,您可能需要查看项目的新工作副本。如果您有任何修改过的、未提交的文件,您将需要将它们复制到新的工作副本中,这样您就不会丢失您的更改。

See this page in the Tortoise SVN docs for a description of the three usages of "lock": http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-locking.html

请参阅乌龟SVN文档中的这一页,描述“锁定”的三个用法:http://玳isesvn.net/docs/nightly/玳瑁。

Excerpt (emphasis added):

摘录(重点):

The Three Meanings of “Lock”

“锁”的三层含义

In this section, and almost everywhere in this book, the words “lock” and “locking” describe a mechanism for mutual exclusion between users to avoid *ing commits. Unfortunately, there are two other sorts of “lock” with which Subversion, and therefore this book, sometimes needs to be concerned.

在本节中,几乎在本书的每一个地方,“锁定”和“锁定”都描述了在用户之间相互排斥以避免冲突提交的机制。不幸的是,还有另外两种“锁定”,即Subversion,因此这本书有时需要关注。

The second is working copy locks, used internally by Subversion to prevent *es between multiple Subversion clients operating on the same working copy. Usually you get these locks whenever a command like update/commit/... is interrupted due to an error. These locks can be removed by running the cleanup command on the working copy, as described in the section called “Cleanup”.

第二个是工作复制锁,用于在内部使用Subversion来防止在同一工作副本上运行的多个Subversion客户机之间的冲突。通常,每当命令如update/commit/…由于错误而中断。可以通过在工作副本上运行清理命令来删除这些锁,正如在“清理”一节中所描述的那样。

...

#6


2  

I had no idea what file was having the lock so what I did to get out of this issue was:

我不知道这个锁有什么文件所以我从这个问题中得到的是:

  1. Went to the highest level folder
  2. 进入了*别的文件夹。
  3. Click clean-up and also ticked from the cleaning-up methods --> Break locks
  4. 点击清理,并从清理的方法——>断头锁上滴答滴答。

This worked for me.

这为我工作。

#7


1  

I had tried various things, including "Clean Up" on lower subdirectories. Finally, I tried updating the top level folder. Nothing. Then I read the "Clean up top level" tip. I tried that. The clean up part succeeded, but the lock remained. My solution was to go back to the top level, clean up, then clean up each red (!) folder I could drill down to. After all was "Cleaned up", the update worked perfectly. The "break lock" tip looks good, too, with the exception that someone on your team might have a legitimate lock on things.

我尝试过各种方法,包括在更低的子目录上“清理”。最后,我尝试更新顶层文件夹。什么都没有。然后我读了“清理顶层”的提示。我试过。清理部分成功了,但锁仍在。我的解决方案是回到顶层,清理干净,然后清理我可以钻到的每个红色(!)文件夹。在“清理完毕”之后,更新工作非常顺利。“断锁”提示看起来也很好,但是您的团队中的某些人可能拥有合法的锁。

#8


0  

I managed to lock myself out of a file in svn - don't know how - but when I tried (re)-getting the lock (Tortoise was showing the "Get Lock" option for the file), it complained that already had the lock. I tried deleting the file and committing the directory change - same result. I tried CleanUp (including refreshing the overlay), but that failed too.

我设法把自己锁在了svn的一个文件中——不知道是怎么回事——但是当我尝试(重新)得到锁的时候(乌龟正在显示文件的“Get lock”选项),它抱怨已经有了锁。我尝试删除文件并提交目录更改——同样的结果。我尝试过清理(包括刷新覆盖),但也失败了。

The solution was to go into the Tortoise repo-browser, find the file and use the break lock function.

解决方案是进入乌龟的repo-browser,找到文件并使用break lock函数。

#9


-1  

Windows Solution:

Windows的解决方案:

https://sourceforge.net/projects/win32svn/

https://sourceforge.net/projects/win32svn/

1.Download it, then add it to system path.

1。下载它,然后将它添加到系统路径。

2.Go to work directory execute "svn clean" and "svn update" in cmd.

2。在cmd中执行“svn clean”和“svn update”。