6

Post-installation of 10.8 and Xcode 4.4 when I try to push to a remote using the Xcode integration Xcode is telling me 'no remotes found'. I am still able to push successfully via command line so my actual repositories are fine. I've installed the command line tools and have tried restarting Xcode several times. Additionally, if I go to Organizer and try to select the repository all I get is a spinning activity indicator. If I select 'remotes' for a given repository it's blank. Note that Xcode does recognize git is available though as it does show which files are modified and allows commits. Reported system git version in /usr/bin/ is:

git version 1.7.9.6 (Apple Git-31.1)

Is anyone else experiencing this, or do you have any suggestions for a remedy (or at least a place to look at a log to see what is going wrong)?

UPDATE 10/18/13

This issue has been resolved in Xcode 5.

shawnwall
  • 4,549
  • 1
  • 27
  • 38
  • How does your location string look like in the Organizer? – Tomas Camin Aug 07 '12 at 09:20
  • The location strings look fine. Also, I noted that this has stopped working for beanstalkapp remotes and not github remotes. The strings look equivalent in terms of structure between the two. Origins are not showing up on beanstalkapp repo's though in the UI as there is no remote named origin (they are named beanstalk), but this used to work just fine in the past. – shawnwall Aug 08 '12 at 14:23
  • I renamed my remote to be 'origin' instead of beanstalk to see if for some reason Xcode now cared about this. After deleting the repo details in organizer and reloading, the origin now displays in the UI. I still have the same persistent problem of 'no remotes found' when trying to push though. – shawnwall Aug 08 '12 at 14:32
  • I had troubles myself making Xcode work with git. I'm using private repositories which are accessed via ssh and basically I had to: 1) change the location string from user@server:repo.git to ssh://user@server/absolute/path/to/repo.git 2) remove from keychain passwords associated with user@serv 3) remove and add remote repository again. – Tomas Camin Aug 08 '12 at 14:33
  • Ah, my location strings are of the format git@host.com:/reponame.git – shawnwall Aug 08 '12 at 14:46
  • submitted to apple rdar://12056076 – shawnwall Aug 08 '12 at 15:44
  • Hi @shawnwall did you fix your "no remote found" problem ? I have the same problem. Sometimes the remote is found, other times not (with command line, it's ok). – darksider Jan 02 '13 at 11:06
  • I honestly haven't checked in a good while. I gave up on xcode's git integration and have stuck to the command line. – shawnwall Jan 02 '13 at 15:30
  • I just pinged my rdar on it as Apple never even acknowledged it. – shawnwall Jan 02 '13 at 15:36

8 Answers8

5

When you add the remote repository in Xcode or in command line (doesn't matter from where you add it) make sure that you use the full path for your repository.

E.g.:

From commandline it's enough to specify

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

when your example.git is located in gituser's home directory. However Xcode can't deal with this annotation and says "No remotes found" when you try pushing your commits to this remote repository.

In order to satisfy Xcode you should type the whole path like:

git remote add <name> gituser@gitserver:/home/gituser/example.git
dersimn
  • 805
  • 9
  • 15
1

I have found this solution for Xcode with Git:

Organizer > remotes > origin

1) remove old remote

2) add new remote:

  • remote name: origin

  • location: same as before, but replace all ":/" or "//" by "/" only

Cœur
  • 37,241
  • 25
  • 195
  • 267
0

you need first add a remote repository: git remote add yourname https://github.com/user/repo.git

and than push... and xcode find the remote repo and can push too.

boxi
  • 1,122
  • 1
  • 8
  • 14
  • As stated in the original post I do have remotes configured and I am able to push to them from command line. I cannot push from Xcode itself. – shawnwall Jul 31 '12 at 01:46
0

I've had the same issue with SSH defined hosts.
My ~/.ssh/config looks like this:

Host myGitServer
HostName {real address goes here}
{Some more config for the host here}

My repository remote URL was in the form of ssh://myGitServer/git/project.git

The problem was that XCode did not read the SSH config to resolve "myGitServer" so the repository was always "offline" for it. I ended up adding "myGitServer" to /etc/hosts.

I guess that among other things, the "no remotes found" issue is caused when XCode can't directly resolve the name of the GIT remote server.

Moshe Gottlieb
  • 3,963
  • 25
  • 41
0

I had the same problem with Xcode 4.6.3.

Here are the steps I performed to resolve the problem:

1. In Xcode I went to File -> Source Control -> Repositories (which opens the Organizer)

2. I then selected the Remotes object from the tree for the Repository I was having the problem with.

3. My remote was named origin, however when expanding it, I noticed it did not have a Branch associated with it.

4. I then selected the remote origin and pressed the Remove Remote option, which removed the remote origin from the view.

5. I then went to a terminal and re-added the remote with:-

`git remote add origin http://username@localhost:7990/scm/iac/main-repository.git`

6. I then needed to add the branch(es) to this remote, which did not worked correctly initially, so I then forced it using the -f command. The command I used was:-

`git push origin master -f`

Note: It may have been possible to skip steps 4 and 5 and just go straight to step 6. I had removed the remote, so did not have the chance to test this.

Note 2: You will need to restart Xcode (or possibly just the Organizer) to see that the remote and branch are now available.

Remixed123
  • 1,575
  • 4
  • 21
  • 35
0

I had a similar problem where remotes were failing to load, specifically for kiln as the remote host. Looking in the git config for the repository info, the URL had been changed to prepend my email address to it.

So I simply exited Xcode, and then from the command line did:

git remote set-url kiln https://...kiln repo name.git

And that seemed to fix it when I restarted Xcode - both pull & push worked again.

I have no idea why Xcode corrupted the URL. This was with Xcode 4.6.3

Greg Whitfield
  • 5,649
  • 2
  • 30
  • 32
0

1- search and apply the guideline. which is mentioned about "show all hidden files in mac finder". and delete .git directory (this folder wont appear without solving article-1)

2-XCode>Prefences>Accounts>Delete github account and close xcode. than open and reconfigure same github account by adding all over.

3-click the section small icon namely "source control navigation" (which is near the project navigator). as you right click a popup will appear. and choose create blabla on github". actually this steps solved same issue.

Zen Of Kursat
  • 2,672
  • 1
  • 31
  • 47
0

Xcode 10.2.1

Double Check:

1) Git Acc under preferences. 2) cmd + 2, right click under remote to create a remote.

Tech Luthiers
  • 196
  • 1
  • 5