English 中文(简体)
为什么Git在克隆时扔 " 未能装载图书馆 libcurl-4.dll "?
原标题:Why did Git throw "Failed to load library libcurl-4.dll " while cloning?

我当时正在一个当地的仓库里克隆我的私人GitHub库,但Git扔了一个“强势”的“强势”ERROR

$ git clone https://github.com/Charley2012/CHMS.git D:homescharley编程编程CCHMSCHMS.git
Cloning into  D:homescharley编程编程CCHMSCHMS.git ...
fatal: failed to load library  libcurl-4.dll 

I have used cmd.exe (Windows command prompt) and Git Bash, but they both threw the same error message above. I have reinstalled Git but that does not make any difference.
I have tried to clone other GitHub repositories but I got the same error message.
GitHub Desktop has successfully cloned the repository, but the reason behind this success is unclear.

I think the problem was caused by a local reason.
I am using Windows 10 and Git 2.41.0.
The files of Git (e.g.git.exe) is under D:homescharley编程编程DevToolsGitcmd.

最佳回答

由于这是我回答我自己的问题, 在将 Git 重新安装到不同的目录后, 问题就解决了。

我发现问题的原因是,Git所在的目录是D:homescharleyDevTools ,该目录包含中文字符“{{}}}}。Git的新目录是S:CharleyDevTools ,该目录不包含特殊字符。

克隆的指挥线信息:

$ git clone https://github.com/Charley2012/CHMS.git E:charley编程编程CCHMSCHMS.git
Cloning into  E:charley编程编程CCHMSCHMS.git ...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 15 (delta 2), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (15/15), done.
Resolving deltas: 100% (2/2), done.
Updating files: 100% (3/3), done.  

在我看来, 因为Git目录包含中文字符, Git 无法正确访问 libcurl-4.dll , 因为将 UTF-8 字符转换为 GBK (GB2312) 或类似字符有问题 。

问题回答

这就是我的解决方案:

  1. Download libcurl-4.dll here: https://www.dll-files.com/search/?q=libcurl-4.dll.
  2. Put this file in [C :WindowsSysWOW64].
  3. Reinstall Git.




相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签