Learn Courses My Dashboard

xCode to GitHub Error

Hi all
All of a sudden I am getting the following error when I want to commit and push to GitHub. Any idea how I resolve this issue? I have even tried to detele ll the files locally and then pull them, which works, but it does not seem to resolve this error and it also does not seem that I can upload to GitHub either.
Screen Shot 2021-04-26 at 10.01.52 pm
Thanks!
Hannes

Hi Hannes,

You should pull changes from Github before you push your code.

It seems like they got out of sync somehow. Do you have any changes locally (on your computer) that aren’t in GitHub??

If not, (local and remote are the same) you can just completely delete the project from your computer and clone it again

Thanks Mikaela
It seems it does not matter what I try. I can try to pull, I can remove everything and build the project from scratch, no matter what I do, GitHub gives me trouble. When I try to pull, I get the following:

I have deleted all tokens, regenerated the token, added into the Preferences>Accounts, all to no avail. I never thought just getting XCode to talk with GitHub would be THIS problematic! Any pointers?
Hannes

That’s a different error than last time. Git and GitHub are easy to use, but can be easy to mess up too.

Do you have any unsaved changes that are in your local repo that are not in your remote repo?

No and I have mode local backups. One question though: is it a problem to have more than one computer connected to GitHub using the same token?

Just completely delete your project and clone it again.

And overall I think there should only be one token per computer

Should every computer have a separate token?

I think, but I’m not 100% sure, you can google that and repost back here

I think I have very similar situation to Hannes. I have done everything I can think of and Xcode will not let me push to the repository. I do think I have changes since I was able to push. I created a whole new repository, but Xcode tells me I have already saved changes to this code. What do I have to change for Xcode/github to let me save as a new project? Should I Clone? will that work? I have a saved copy, but not sure what to change to get it recognize I want to start from here and not from where ever I was 2 weeks ago. . I do have two different computers, and the problem started when I moved to new Mac mini.

Wait so how did this start?

You’d see the code in the repo on GitHub, something like this

Did you create a new local repo or new one in GitHub?

—-

What you should do:

  • add the remote repo to Xcode in the source navigator
  • push the code to that repo (in Xcode)

Did that, like multiple times. It was a remote repository on GitHub. I have real consistent results now, whether I try to push or whether I try to pull. Tried to create a new repository and just push the code - it says the code is all under source control. If I try to pull it has an " unexpected error". I gave up and send an communication to GitHub. I spent a good 4 hours trying to research and fix.
Deleted and account from Xcode, added it back with a new access code.

Can you record your screen of trying to push to GitHub
(You can use QuickTime to record your screen)

Yes, I tried to do the recording. will reply to your email as I don’t see a way to attach the recording here