关闭

Git with Smart HTTP in Cygwin

1839人阅读 评论(0) 收藏 举报
分类:

Executive summary: In order to use git in Cygwin with Smart HTTP style URLs, you need to also install the libsasl2 and ca-certificates packages.

I recently set up a new Cygwin environment to test and document the process of cloning and using one of the OpenXC repositories from GitHub in Windows, since this is a very popular platform for many users. Unfortunately many people were being blocked at the very first step, just attempting to clone the repository.

GitHub transitioned a little while back to using Smart HTTP by default for all public repositories. This is great because even for folks that need to commit to repositories, they can skip the SSH key dance if they aren't already using that in their daily routine. This seems to be especially the case for Windows users.

So for OpenXC, a new users installs Cygwin with the "git" package and attempts to clone the repository, and it explodes:

$ git clone https://github.com/openxc/openxc-android
Cloning into 'openxc-android'...
/usr/lib/git-core/git-remote-https.exe: error while loading shared
    libraries: ?: cannot open shared object file: No such file or directory

I was able to figure out which library was missing by using cygcheck:

$ cygcheck /usr/lib/git-core/git-remote-https.exe
C:\cygwin\lib\git-core\git-remote-https.exe
  C:\cygwin\bin\cygcrypto-0.9.8.dll
    C:\cygwin\bin\cygwin1.dll
      C:\Windows\system32\KERNEL32.dll
        C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
        C:\Windows\system32\ntdll.dll

    ... <snip> ...

    C:\cygwin\bin\cyglber-2-4-2.dll
    C:\cygwin\bin\cygldap-2-4-2.dll
      C:\cygwin\bin\cygssl-1.0.0.dll
    C:\cygwin\bin\cygssh2-1.dll
cygcheck: track_down: could not find cygsasl2-2.dll

This tells me that libsasl2 is missing, so install that from the Cygwin package manager.

Try the clone again and it still fails:

$ git clone https://github.com/openxc/openxc-android.git
Cloning into 'openxc-android'...
error: error setting certificate verify locations:
  CAfile: /usr/ssl/certs/ca-bundle.crt
  CApath: none while accessing
        https://github.com/openxc/openxc-android.git/info/refs
fatal: HTTP request failed

By default, Cygwin doesn't have the CA root certificates installed, so nothing using SSL will work properly. Install the ca-certificates package to install those.

Finally, success:

$ git clone https://github.com/openxc/openxc-android
Cloning into 'openxc-android'...
remote: Counting objects: 13997, done.
remote: Compressing objects: 100% (2759/2759), done.
remote: Total 13997 (delta 7568), reused 13989 (delta 7560)
Receiving objects: 100% (13997/13997), 9.30 MiB | 1.04 MiB/s, done.
Resolving deltas: 100% (7568/7568), done.

This problem was a little difficult to debug because I don't think very many people encounter it. Typically when someone installs Cygwin, they also install a base set of packages that includes things like curl. Well, one of the curl package's many dependencies are both libsasl2 and ca-certificates, which explains why many people do not encounter this problem.


http://christopherpeplin.com/2013/01/cygwin-git-https/

0
0
查看评论

git 服务器搭建 (git smart http)

服务器 UBUNTU 11.04 (写了一下操作步骤, 理论网上找吧, 我也说不清楚, 呵) (FIXME: 服务器上操作) 1. 更新当前系统 rdserver@server249:~/Desktop$ sudo apt-get update rdserver@server249:~/D...
  • zhangzhenghe
  • zhangzhenghe
  • 2012-08-18 15:20
  • 2784

在centos中搭建基于smart http的git server

在centos中搭建基于smart http的git server由于公司的特殊需求,需要将git集成到IBM的RTC里面,而RTC使用的是http,所以要只能放弃了git原生的ssh,转而使用smart http,git server搭建在centos系统上。博主在浏览了N多教程发现都是比较残缺的...
  • zsq_519
  • zsq_519
  • 2016-04-21 14:39
  • 2995

windows cygwin安装git

web url:http://jattenberg.github.io/PDS-Fall-2013/assets/GitInstallationGuide.pdf Git Installation Guide on Windows to work wit...
  • mine_1
  • mine_1
  • 2014-06-20 15:12
  • 4075

Windows下Git的安装与配置(Cygwin)

Windows下Git的安装与配置(Cygwin) 引子 Git应该是目前最火热的源代码管理软件,虽然是从Linux中走出来的,但在Windows端的表现也是非常抢眼,大有取代SVN之势。  但是刚开始用Git的时候,总感觉不是很顺手,没有SVN好用,在SVN的世界里最出名的客...
  • a191030148
  • a191030148
  • 2015-04-02 16:21
  • 4229

Windows下与Cygwin一起使用git

Windows下与Cygwin一起使用git
  • Blank557
  • Blank557
  • 2016-08-30 11:01
  • 2187

cygwin下使用git

在cygwin下使用git,会遇到路径无法直接传递给windows下的程序的情况,比如gvim, p4merge等,所以需要一个脚本,将cygwin的路径转换成windows的路径,这里用到了cygpath这个工具,具体脚本见下(脚本内容源自http://vim.wikia.com/wiki/U...
  • seizeF
  • seizeF
  • 2012-01-08 14:29
  • 4254

windows下使用cygwin搭建git服务器

在windows上搭建git服务器需要分两步, 首先, 要在windows环境下实现ssh服务器, 以及通过public key的autorized登陆. 其二, 要在windows下安装git或者带gui shell的git 由于windows下面原生不支持ssh协议, 网上多数教程都是通过一...
  • vector03
  • vector03
  • 2016-11-20 20:23
  • 4264

在win7下面使用cygwin,并且安装使用git,以及git简明教程

cygwin是win7下面的虚拟linux的程序(可以简单这么理解。)安装的时候直接去官网下载setup.exe文件,双击安装,首先选择源,最好是选择国内的,然后选择自己要安装的程序,很简单就可以完成。        git,开发者就是写linux的...
  • Allen_Zhao_2012
  • Allen_Zhao_2012
  • 2013-01-09 16:23
  • 11764

完善Cygwin git使用

这篇文档音自http://herry2013git.blog.163.com/blog/static/2195680112013437139447/
  • tryhl
  • tryhl
  • 2014-11-05 06:35
  • 777

【git】在cygwin中git 不能补全git 的命令

首先获得源码 git clone git://git.kernel.org/pub/scm/git/git.git 从源码中拷贝git-completion.bash到用户主目录下. git-completion.bash cp git/contrib/completion/git-compl...
  • JCRunner
  • JCRunner
  • 2015-08-08 17:52
  • 985
    个人资料
    • 访问:173742次
    • 积分:1503
    • 等级:
    • 排名:千里之外
    • 原创:21篇
    • 转载:12篇
    • 译文:0篇
    • 评论:23条
    文章分类
    最新评论