Reputation: 855
I have my project in git and we are 2 programmers working in the project. User B using (xcode 8.2.1) added some files and pushed to remote. User A using (xcode 8.0) also added some files committed changes clicked to pull it went through with out any messages, but the new files created by user B are not pulled. User A tried to push and this message shows up:
"The local repository is out of date. Make sure all changes have been pulled from remote repository and try again"
How can I fix this problem?
Upvotes: 1
Views: 3536
Reputation: 12194
This is why I steer clear of of using Xcode's Git integration, it is very buggy and offer you less control resulting in not completely understanding what Git is doing...
Open up terminal (cmd + space and type "terminal" then press enter), navigate to your project's location by typing cd
followed by the path to your project on the file system which can be done by dragging the project's directory from Finder into the Terminal app. This should get you something like:
cd /Path/to/my/project/directory/
Press enter. To confirm that you changed your present working directory type pwd
followed by enter and it should regurgitate the path you gave to the cd
command.
Now type git status
it should spit out a git status in terminal, if it complains about the directory not being a valid git repository, make sure you specify a subdirectory of the project to cd
and try again.
Assuming git status
gives you some git status output type git pull
followed by enter. Git will pull your comrade's changes and hopefully there won't be any conflicts...
Going forward I recommend you DO NOT use Xcode's Git integration, instead use Terminal and Fork for working with staging/unstaging and committing files. You will get a better understanding for Git this way and you will not be lied to by Xcode.
Upvotes: 6