"The Local repository is out of date"....i have no branch how to solve this
Solution 1
that warning is because someone else would have pushed to your repo after the last time you pulled from it. you will need to pull from the repo, merge your code and then you will be able to push again
Solution 2
I had the same issue I solved it like that :
first go to the Project directory in your terminal
git init
git add .
git stash save
git branch --set-upstream-to=origin/master
git pull -r
git stash pop
git push
let me know if it works
Solution 3
I had the same issue and it happened because I added the README.md file from the GitHub website by creating another branch to add it. Xcode does not pull changes made through the website automatically.
So you have to go to Xcode menu and select Source Control -> Pull.
And then I checked "Rebase local changes onto upstream changes", this applies local commits one at a time. I had many commits I didn't push, so I chose this.
Related videos on Youtube
Comments
-
SAXENA almost 2 years
When we push the code to the remote server Xcode shows the below warning. Also see the attached screenshot
The Local repository is out of date.
I have no branch or any other working copy.
-
Harry McGovern over 5 yearsThat was the answer for me. I couldn't find a way around the error on XCode.
-
Oleg991 over 4 yearsThis helped me too, though I do not like using terminal.
-
Jorge Zapata about 4 yearsI have this same problem. I tried pulling and it says I am already up to date. Should I force push?
-
Peter Schorn over 3 yearsDoesn't
git init
create a completely new repository? -
H.Epstein over 3 yearsgit init is not creating a new repository it will just set up a git project, it will not affect your remotes or branches
-
Zack almost 3 yearsHow do I reverse this? I just lost all my work without any backup
-
JCutting8 about 2 yearsIm a single developer team, I don't even know how this is possible!?