Xcode 4.4 - 找不到遥控器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11724847/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:04:25  来源:igfitidea点击:

Xcode 4.4 - no remotes found

xcodegit

提问by shawnwall

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 doesrecognize git is available though as it does show which files are modified and allows commits. Reported system git version in /usr/bin/ is:

安装 10.8 和 Xcode 4.4 后,当我尝试使用 Xcode 集成推送到遥控器时,Xcode 告诉我“找不到遥控器”。我仍然能够通过命令行成功推送,所以我的实际存储库很好。我已经安装了命令行工具并尝试了多次重启 Xcode。此外,如果我转到 Organizer 并尝试选择存储库,我得到的只是一个旋转活动指示器。如果我为给定的存储库选择“远程”,则它是空白的。请注意,Xcode确实识别出 git 可用,因为它确实显示了哪些文件被修改并允许提交。/usr/bin/ 中报告的系统 git 版本是:

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

更新 10/18/13

This issue has been resolved in Xcode 5.

此问题已在 Xcode 5 中解决。

回答by dersimn

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.

当您在 Xcode 或命令行中添加远程存储库时(与添加位置无关),请确保使用存储库的完整路径。

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.

当您的 example.git 位于 gituser 的主目录中时。但是,当您尝试将提交推送到此远程存储库时,Xcode 无法处理此注释并显示“未找到遥控器”。

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

为了满足 Xcode,您应该键入整个路径,例如:

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

回答by Remixed123

I had the same problem with Xcode 4.6.3.

我在 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)

1.在 Xcode 中,我转到 File -> Source Control -> Repositories(打开管理器)

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

2.然后我从树中为我遇到问题的存储库选择了 Remotes 对象。

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

3.我的遥控器被命名为 origin,但是在扩展它时,我注意到它没有与之关联的 Branch。

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

4.然后我选择了远程源并按下了移除远程选项,这会从视图中移除远程源。

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

5.然后我去了一个终端并重新添加了遥控器:-

`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:-

6.然后我需要将分支添加到这个遥控器,它最初没有正常工作,所以我然后使用 -f 命令强制它。我使用的命令是:-

`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.

注意:可能可以跳过第 4 步和第 5 步,直接进入第 6 步。我已经卸下了遥控器,因此没有机会对此进行测试。

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

注意 2:您需要重新启动 Xcode(或可能只是管理器)以查看远程和分支现在可用。

回答by C?ur

I have found this solution for Xcode with Git:

我用 Git 为 Xcode 找到了这个解决方案:

Organizer > remotes > origin

组织者 > 遥控器 > 起源

1) remove old remote

1)删除旧的遥控器

2) add new remote:

2)添加新的遥控器:

  • remote name: origin

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

  • 远程名称:起源

  • 位置:与之前相同,但仅将所有“:/”或“//”替换为“/”

回答by Greg Whitfield

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.

我有一个类似的问题,远程无法加载,特别是对于作为远程主机的窑。在 git config 中查看存储库信息,URL 已更改为在它前面添加我的电子邮件地址。

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

所以我简单地退出了 Xcode,然后从命令行执行:

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.

当我重新启动 Xcode 时,这似乎解决了它——pull 和 push 再次工作。

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

我不知道为什么 Xcode 损坏了 URL。这是 Xcode 4.6.3

回答by Kursat Turkay

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)

1- 搜索并应用指南。提到了“在mac finder中显示所有隐藏文件”。并删除.git目录(不解决article-1就不会出现这个文件夹)

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

2-XCode>Prefences>Accounts>删除github账号并关闭xcode。比通过添加所有内容来打开和重新配置相同的 github 帐户。

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.

3 单击“源代码管理导航”部分小图标(位于项目导航器附近)。当您右键单击时,将出现一个弹出窗口。并选择在 github 上创建 blabla”。实际上这些步骤解决了同样的问题。

回答by Tech Luthiers

Xcode 10.2.1

Xcode 10.2.1

Double Check:

再检查一遍:

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

1) 偏好下的 Git Acc。2)cmd + 2,在remote下右键创建一个remote。

回答by Moshe Gottlieb

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

我在 SSH 定义的主机上遇到了同样的问题。
我的~/.ssh/config看起来像这样:

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

我的存储库远程 URL 的形式为 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.

问题是 XCode 没有读取 SSH 配置来解析“myGitServer”,因此存储库始终处于“离线”状态。我最终将“myGitServer”添加到/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.

我想除其他外,当 XCode 无法直接解析 GIT 远程服务器的名称时,会导致“找不到遥控器”问题。

回答by boxi

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

你需要先添加一个远程仓库:git remote add yourname https://github.com/user/repo.git

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

而不是 push ... 和 xcode 找到远程仓库并且也可以推送。