xcode 存储库已锁定 - 尝试提交到源代码管理时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32990720/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The Repository is Locked - Error while trying to commit into source control
提问by cmario
I was trying to commit files into my source control (Git) as usual, using Xcode 7.0.1 and from a point onwards I keep getting this message, disallowing me to commit changes into my source control:
我试图像往常一样使用 Xcode 7.0.1 将文件提交到我的源代码管理 (Git) 中,从那时起我不断收到此消息,不允许我将更改提交到我的源代码管理中:
Anyone know how to resolve this?
有谁知道如何解决这个问题?
回答by daliso
It's just a common issue faced if two or more git operations are done by your system and that generates a lock file.
如果您的系统完成了两个或多个 git 操作并生成锁定文件,这只是一个常见问题。
All you need to do is:
您需要做的就是:
- Close Xcode
- Open the .git folder in your xcode project folder. The folder is hidden, so you would need to either use terminal to open the directory or the "Go to Folder" option in Finder.
- Then delete the "index.lock" file. Either through terminal or Finder.
- Try and commit again.
- If it fails again, repeat 1 to 3 but commit first with terminal.
- 关闭 Xcode
- 打开 xcode 项目文件夹中的 .git 文件夹。该文件夹是隐藏的,因此您需要使用终端打开目录或 Finder 中的“转到文件夹”选项。
- 然后删除“index.lock”文件。通过终端或 Finder。
- 尝试并再次提交。
- 如果再次失败,请重复 1 到 3,但首先使用终端提交。
If you know what you're doing just typing this command into terminal in the current directory of your project and it should delete the lock file: rm -f .git/index.lock
如果您知道自己在做什么,只需在项目当前目录的终端中输入此命令,它就会删除锁定文件: rm -f .git/index.lock
If anything you can check this Quora question for more details on what you've faced: https://www.quora.com/Why-do-my-git-operations-often-fail-with-a-lock-error
如果有任何事情,您可以查看此 Quora 问题以获取有关您所面临问题的更多详细信息:https: //www.quora.com/Why-do-my-git-operations-often-fail-with-a-lock-error
Hope that helps you guys, and happy coding!
希望对你们有帮助,祝你编码愉快!
回答by smoothumut
Also make sure the simulator is not running while you are commiting. Close both simulator and Xcode. then restart and try again
还要确保在您提交时模拟器没有运行。关闭模拟器和 Xcode。然后重新启动并重试