How to add you xcode project to github

So you created a brand new xcode project and selected a local repository and are wondering how to add it to github?

Fear not, below steps to make it happen:

Summary:

  1. Navigate to the path of your xcode project and run:
    git remote add foodTracker https://github.com/ACCOUNT/REPOSITORY
  2. Pull the changes
    Git will complain of “fatal: refusing to merge unrelated histories”  solution”–allow-unrelated-histories” use the option
    git pull REPOSITORY master –allow-unrelated-histories
  3. Now you should be able to push from xcode

Other useful commands:

  • git show remote
  • git remote remove REPOSITORY

Happy coding!

Categories: Git

Leave a Reply

Your email address will not be published. Required fields are marked *