简体   繁体   English

Git 在 Mac 上克隆 HTTPS 不工作

[英]Git clone on Mac with HTTPS not working

I use Git in Windows and Linux on a daily basis and I was just trying to get it going on my Mac but am having an issue doing a simple git clone . I use Git in Windows and Linux on a daily basis and I was just trying to get it going on my Mac but am having an issue doing a simple git clone . I used the installer from the Git website as well as the bash script which adds the environment variable in ~/.MacOSX我使用了来自 Git 网站的安装程序以及 bash 脚本,它在~/.MacOSX中添加了环境变量

I say that because I'm not completely sure everything is setup correctly, I also have the ssh key added to my github account.我之所以这么说,是因为我不完全确定一切设置是否正确,我还将 ssh 密钥添加到我的 github 帐户中。

So heres the full output from the terminal所以这是来自终端的完整 output

myComp:Sites me$ git clone https://github.com/me/some_project.git
Cloning into some_project...
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/me/some_project.git/info/refs

fatal: HTTP request failed
myComp:Sites me$

Here is what the environment.plist looks like:这是 environment.plist 的样子:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>PATH</key>
    <string>/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin</string>
</dict>
</plist>

This is what worked for me and it may or may not be the best solution but its certainly the easiest.这对我有用,它可能是也可能不是最好的解决方案,但它肯定是最简单的。

git config --global --add http.sslVerify false

I researched your problem a bit and found someone that had a similar issue.我研究了你的问题,发现有人有类似的问题。 Apparently what the issue was for them was that they had a duplicate environment variable in their path.显然,对他们来说问题是他们的路径中有一个重复的环境变量。 Are you positive that git has not already been installed on this machine before?您确定 git 之前还没有安装在这台机器上吗? Could you take a look at your ~/.MacOSX file and see if there is anything fishy going on in it?你能看看你的 ~/.MacOSX 文件,看看里面有没有什么可疑的地方吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM