git GitHub上的“Clone in Mac”失败,每次都带我去下载页面

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12011030/
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-19 07:21:55  来源:igfitidea点击:

"Clone in Mac' fails on GitHub. Takes me to download page every time

macosgitosx-mountain-liongithub-for-mac

提问by Bit Rocker

I've reinstalled, uninstalled, restarted but "Clone in Mac' on any repository page fails and takes me to the GitHub download page every time.

我已经重新安装、卸载、重新启动,但是任何存储库页面上的“在 Mac 中克隆”都失败了,并且每次都将我带到 GitHub 下载页面。

It was working fine earlier this week but today won't do anything useful.

本周早些时候它运行良好,但今天不会做任何有用的事情。

Any idea why?

知道为什么吗?

回答by Neil

It appears not only do you have to log in to the website, you have to log in to the application once as well so it knows you've got it installed. Then refresh the git repo page and the links will automagically change from the download page to an open-application page.

看来您不仅必须登录该网站,还必须登录该应用程序一次,以便它知道您已安装该应用程序。然后刷新 git repo 页面,链接将自动从下载页面更改为打开的应用程序页面。

回答by Jason Lindberg

I tried the above suggestions of making sure I was logged in to both the site and the Github-Mac application (which I already was) and installing the CLI tools. This didn't fix it for me. After some digging I found this articlewhich explains how it works.

我尝试了上述建议,以确保我同时登录了站点和 Github-Mac 应用程序(我已经登录了)并安装了 CLI 工具。这对我没有解决。经过一番挖掘,我发现了这篇文章,它解释了它是如何工作的。

There should be a server listening on your localhost with https://ghconduit.com:25035/statusand it should return a json string that looks something like this:

应该有一个服务器使用https://ghconduit.com:25035/status侦听您的本地主机,它应该返回一个如下所示的 json 字符串:

{"capabilities":["status","unique_id","url-parameter-filepath"],"running":true,"server_version":"5"}

In my case I did not get a result so I tried 127.0.0.1 instead of ghconduit.com and that fixed it.

就我而言,我没有得到结果,所以我尝试了 127.0.0.1 而不是 ghconduit.com 并修复了它。

TL;DR: Add an entry for 127.0.0.1 ghconduit.comto your /etc/hosts file and refresh the github page you are on and the clone on desktop function will work.

TL;DR:127.0.0.1 ghconduit.com在您的 /etc/hosts 文件中添加一个条目并刷新您所在的 github 页面,桌面克隆功能将起作用。

回答by Nevik Rehnel

As was noted in the comments: You must be logged into Github for the "Clone on Mac" button work.

正如评论中所指出的:您必须登录到 Github 才能进行“在 Mac 上克隆”按钮的工作。

(This answer serves mostly to remove this question from the "unanswered" list, since the asker does not seem to be closing it)

(这个答案主要是为了从“未回答”列表中删除这个问题,因为提问者似乎没有关闭它)

回答by TigerCoding

Even doing all the above failed for me, but here's what did work:

即使做以上所有的事情对我来说都失败了,但这是有效的:

Open a new tab.

打开一个新选项卡。

Paste this in the address bar (without quotes): "github-mac://openRepo/"

将此粘贴到地址栏中(不带引号):“github-mac://openRepo/”

On the repo you want to clone, copy the HTTPS clone URL, and paste it after the link above. Press enter.

在要克隆的存储库上,复制 HTTPS 克隆 URL,并将其粘贴到上面的链接之后。按回车键。

If the server is listening on your Mac @rjason-lindberg mentioned, then it should open up in GutHub for Mac.

如果服务器在 @rjason-lindberg 提到的 Mac 上侦听,那么它应该在 GutHub for Mac 中打开。

回答by rndeon

I just had this problem, and I found two steps necessary to get it working: the "log in" answer above, and to open GitHub.app, got to Preferences > Advanced > Install Command Line Tools. This took no time. I then refreshed the github page, and saw that the link now led to something like: "github-mac://openRepo/https://github.com/......" Click it and it worked.

我刚刚遇到了这个问题,我发现需要两个步骤才能使其正常工作:上面的“登录”答案,然后打开 GitHub.app,转到首选项 > 高级 > 安装命令行工具。这没有花时间。然后我刷新了 github 页面,看到链接现在导致类似:“github-mac://openRepo/ https://github.com/......”点击它,它起作用了。

回答by Bit Rocker

I have answered my own question: the trick is TO BE LOGGED IN on the GitHub website. As stated by Neil above, you need to be logged into the application too.

我已经回答了我自己的问题:诀窍是在 GitHub 网站上登录。正如上面 Neil 所说,您也需要登录到应用程序。

回答by rinogo

None of the other answers worked for me. I tried logging out (both GitHub and GitHub for Mac), revoking the application access key, quitting the application, reinstalling the GitHub command-line tools (via the Preferences pane), etc.

其他答案都不适合我。我尝试注销(GitHub 和 Mac 版 GitHub)、撤销应用程序访问密钥、退出应用程序、重新安装 GitHub 命令行工具(通过“首选项”窗格)等。

What did work for me:

什么对我有用:

  1. Clone (Edit: I think I might have meant "Fork"?*) the repository on github.com. (Yes, through the web interface)
  2. In the GitHub for Mac application, access File > New Repository... and choose "Clone". Select the repo you just created on github.com and clone on, my friend! Clone on.
  1. 克隆(编辑:我想我的意思可能是“Fork”?*)github.com 上的存储库。(是的,通过网络界面)
  2. 在 GitHub for Mac 应用程序中,访问 File > New Repository... 并选择“Clone”。选择你刚刚在 github.com 上创建的 repo 并克隆,我的朋友!克隆。

*It has been a while since I wrote this answer, so I'm not sure if I actually did mean "Clone"... I understand that forking and cloning are certainly not the same thing. I'll leave this answer here in case it happens to inspire a thought for someone!

*我写这个答案已经有一段时间了,所以我不确定我是否真的是在说“克隆”......我知道分叉和克隆肯定不是一回事。我会在这里留下这个答案,以防它碰巧激发了某人的想法!

回答by vkkumar

I just tried this and it seemed to work.

我刚试过这个,它似乎有效。

  • Go to Keychain Access and delete all stored passwords (Internet, application, Web form) with reference to GitHub.
  • Login in fresh on to the site as well as from the Mac OS desktop application
  • Store the passwords this time
  • 转到 Keychain Access 并参考 GitHub 删除所有存储的密码(Internet、应用程序、Web 表单)。
  • 重新登录网站以及从 Mac OS 桌面应用程序
  • 这次存储密码

回答by Diskutant

None of the other answers did the trick for me. But seeing that neither https://ghconduit.com:25035/statusnor https://localhost:25035/statuswas able to connect I realized that the Conduit process wasn't running. It's in "GitHub.app/Contents/Library/LoginItems/GitHub Conduit" open that, and clone to desktop finally works again. Don't know why GitHub.app didn't start it by itself, but at least it works now.

其他答案都没有对我有用。但是看到https://ghconduit.com:25035/statushttps://localhost:25035/status都无法连接,我意识到 Conduit 进程没有运行。它在“GitHub.app/Contents/Library/LoginItems/GitHub Conduit”中打开,然后克隆到桌面终于再次工作。不知道为什么 GitHub.app 没有自己启动,但至少现在可以运行了。

edit: After each reboot the GitHub Conduit process needs to be manually started again.

编辑:每次重启后,GitHub Conduit 进程需要再次手动启动。