简体   繁体   English

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

[英]xcode git unable to pull changes from the remote repository

I'm developing an iPhone application with another developer. 我正在和另一位开发人员一起开发iPhone应用程序。 Our git repository is situated on the remote server. 我们的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. 并且,请提供有用的提示,以避免将来出现此问题。

I guess xcode uses option to force fast-forward merges when pulling from repository. 我猜xcode使用选项来强制从存储库中提取时快进合并。 That is not bad idea, becouse it prevents you from undesired merges. 这不是一个坏主意,因为它可以防止你不受欢迎的合并。

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. 尝试使用git pull --rebase (分别在xcode中检查一些合适的复选框),它应该删除您的更改,下载新版本,然后将您删除的更改应用回来。 Conflict will occur at the last step so you will solve it and commit that changes again. 冲突将在最后一步发生,因此您将解决它并再次提交更改。 Then you can push them on server. 然后你可以在服务器上推送它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM