Xcode 4.4 - no remotes found

2020-04-05 07:48发布

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.

标签: xcode git
8条回答
小情绪 Triste *
2楼-- · 2020-04-05 08:28

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
查看更多
女痞
3楼-- · 2020-04-05 08:28

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.

查看更多
Bombasti
4楼-- · 2020-04-05 08:30

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

查看更多
兄弟一词,经得起流年.
5楼-- · 2020-04-05 08:32

Xcode 10.2.1

Double Check:

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

查看更多
我想做一个坏孩纸
6楼-- · 2020-04-05 08:35

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

查看更多
够拽才男人
7楼-- · 2020-04-05 08:40

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.

查看更多
登录 后发表回答