Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode git unable to pull changes from the remote repository

Tags:

git

xcode

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

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".

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

like image 268
user1897723 Avatar asked Jan 31 '13 11:01

user1897723


People also ask

How do I use Git repository in Xcode?

Go to Source Control in Xcode and select Projectname -- master, then Configure... In the Address field, paste the Git clone URL for your repo copied in the previous step. Select Add Remote, then select Done to finish creating the origin remote for your local Git repo.

How do you pull changes from a remote to a branch?

In order to fetch these changes from your remote, or in other words, download the changes to your local branch, you will perform a Git pull. Under the covers, a Git pull is actually a Git fetch followed by a Git merge. Git pull is just a shortcut to perform both of these actions in one step.

Can I use Git with Xcode?

Xcode will create your new project along with a new Git repository. All source control systems, including Git, store their data into a repository so that they can manage your project versions and keep track of changes throughout the development cycle. Think of a repository as a database for versions.


1 Answers

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.

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.

like image 79
Josef Kufner Avatar answered Oct 18 '22 01:10

Josef Kufner