Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The Local repository is out of date"....i have no branch how to solve this

Tags:

git

xcode8

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.

Screenshot

I have no branch or any other working copy.

like image 605
SAXENA Avatar asked Jan 12 '18 06:01

SAXENA


3 Answers

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

like image 129
H.Epstein Avatar answered Oct 23 '22 05:10

H.Epstein


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.

enter image description here

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.

enter image description here

like image 10
tiw Avatar answered Oct 23 '22 05:10

tiw


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

like image 6
Karan Shishoo Avatar answered Oct 23 '22 03:10

Karan Shishoo