Pushing to Remote Repository from Xcode: no remotes found (Solved)

Uncategorized Add comments

When adding remote repositories to your projects in Xcode you might find that you are unable to push to the remote repository depending on how you have set the remote repository up.

In my situation I have set up my own git repository for a few reasons:

  • Because I can
  • To learn more about git
  • To have my projects backed up remotely
  • To have a private solution I control
  • There is no additional cost for the above benefits

I opened Xcode and selected the second option on the welcome splash screen ‘Connect to a repository’ and entered my git server and project details. Xcode kindly created a local version on my hard drive and I was content to code away and make commits as usual.

That was all fine and dandy but I noticed a problem when I wanted to sync with the original ‘remote repository’.

So I was expecting to go:

File > Source Control > Push

and the dialog comes up as expected but it says no remotes found.

I went back to the repositories dialog (you can get to it either from the organiser button in the main interface or through the source control menu) and I checked that I’d set the remote repository up seemingly correctly so what was happening?

Well where’s a guy to turn? Why your trusty Stack Overflow of course!

I go the answer from a post titled xcode-4-4-no-remotes-found.

Basically you have to be sure that when you create remote repositories you have specified the full path to git folder so instead of (if you were using the command line) …

git remote add <name> gituser@gitserver:example.git

…you specify…

git remote add <name> gituser@gitserver:/home/gituser/example.git

Its the same when you’re creating the remote repositories in Xcode itself you just need to specify the full path to the git folder on the remote server.

So now when I push the changes to the remote repository the dialog in Xcode tells me the repository is online and I am able to push my changes to it without any issues. I even checked the changes had synced correctly and they had so job done…

Huzzah!

Leave a Reply

WP Theme & Icons by N.Design Studio | Akismet has gobbled 333,331 spam comments...Mmmm Tasty :-)
Entries RSS Comments RSS Log in