xcode git 无法从远程存储库中提取更改

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14624209/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:40:52  来源:igfitidea点击:

xcode git unable to pull changes from the remote repository

xcodegit

提问by user1897723

I'm developing an iPhone application with another developer. Our git repository is situated on the remote server.

我正在与另一位开发人员一起开发 iPhone 应用程序。我们的 git 存储库位于远程服务器上。

So we are working with our working copies and then we do commit, pull, push one by one and we get our local working copies synchronized with server and with each other.

因此,我们正在处理我们的工作副本,然后我们逐一提交、拉取、推送,然后我们将本地工作副本与服务器以及彼此同步。

Everything worked fine until this day. Other developer successfully pushed his changes to the remote repository, and now it is my turn: commit, pull changes from the remote repository, maybe merge them somehow and then push my working copy to the server.

直到今天,一切都运行良好。其他开发人员成功地将他的更改推送到远程存储库,现在轮到我了:提交,从远程存储库中提取更改,也许以某种方式合并它们,然后将我的工作副本推送到服务器。

But when I'm trying to pull changes (using xcode's built-in git) I'm getting an error: "The operation could not be performed because "%reponame%" has one or more tree conflicts".

但是当我尝试拉取更改(使用 xcode 的内置 git)时,我收到一个错误: “无法执行操作,因为“%reponame%”有一个或多个树冲突”

Please, guide me through the process of solving this problem. And, please, provide useful tips to avoid this problem in future.

请指导我完成解决此问题的过程。并且,请提供有用的提示,以避免将来出现此问题。

回答by Josef Kufner

I guess xcode uses option to force fast-forward merges when pulling from repository. That is not bad idea, becouse it prevents you from undesired merges.

我猜 xcode 在从存储库中提取时使用选项来强制快进合并。这不是个坏主意,因为它可以防止您进行不想要的合并。

Try to use git pull --rebase(resp. check some appropriate checkbox in xcode), it should remove your changes, download new version and then apply your removed changes back. Conflict will occur at the last step so you will solve it and commit that changes again. Then you can push them on server.

尝试使用git pull --rebase(分别在 xcode 中检查一些适当的复选框),它应该删除您的更改,下载新版本,然后应用您删除的更改。冲突将发生在最后一步,因此您将解决它并再次提交更改。然后你可以将它们推送到服务器上。