Search code examples
iosxcodegithubxcode7

Xcode and Github not playing together


Trying to use Github for the first time with xCode giving me hard time.

I followed many tutorials but nothing is working for me.

  1. using my Github account, created repo for the project
  2. opened Xcode and created project, with the git check mark checked
  3. opened the source control menu and attached to the Github repo origin/master
  4. tried to push and got: "The local repository is out of date. Make sure all changes have been pulled from the remote repository and try again." message
  5. tried to pull and got: ""origin/master" is not a valid remote branch to pull from. Please choose a different remote branch." but there is not other branch.
  6. tried every thing else and nothing worked

p.s. the first time i did the connection to the remote server i got a popup to enter user and password, now not getting that any more, so i am getting that the connection is not the problem, i can see (or think i can see) the remote repo

Any one got an idea?

Push:

enter image description here

Pull:

enter image description here


Solution

  • OK, fixed the problem!

    Notice when you add README or gitignore files when creating a git repo, nothing that i did could push or pull from and to the local copy.

    eventually i deleted the Github repo and created a clean repo with no files in it.

    Then did the steps from the main repo page and every things worked just fine.

    I thing the issue was that i had deferent files in both the Github repo and the local git repo (the local one has the Xcode project files) and it gave me error after error for many things, starting from clean Github repo and getting the gitignore file in advance and adding it to the local project did the trick for me.

    10x and i hope that helped