在 Windows 中通过 SSH 服务器进行 Git,找不到共享库

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

Git over SSH Server in Windows, cannot find shared libraries

windowsgitsshputty

提问by Roy Marco Aruta

I was to setup an SSH Server to Host my Git Repository to my local area network. I followed this tutorial by TimDavishoping that I would be able to make a secured Git Repository.

我要设置一个 SSH 服务器来将我的 Git 存储库托管到我的局域网。我遵循了 TimDavis 的这个教程,希望我能够制作一个安全的 Git 存储库。

I tested my connection using Putty and it was successful. My only problem was I cannot run "git" command in the console. Then I tried cloning my repository, and this was the error that outputed:

我使用 Putty 测试了我的连接,它成功了。我唯一的问题是我无法在控制台中运行“git”命令。然后我尝试克隆我的存储库,这是输出的错误:

/usr/bin/git-upload-pack.exe: error while loading shared libraries: 
libiconv2.dll: cannot open shared object file: 
No such file or directory

Also when I ran "git" command in the Putty Bash that was connected to the SSH Server, this was the error I encountered:

此外,当我在连接到 SSH 服务器的 Putty Bash 中运行“git”命令时,这是我遇到的错误:

/usr/bin/git.exe: error while loading shared libraries: pthreadGC2.dll: 
cannot open shared object file: No such file or directory

I seems that all my problem was about the missing libraries but I don't know how to solve it. I am using Windows 7 as an Operating System.

我似乎所有的问题都与缺少的库有关,但我不知道如何解决。我使用 Windows 7 作为操作系统。

Thanks

谢谢

采纳答案by Steve

I got this error too. I tried copying not just git.exe but the corresponding dlls (libiconv, etc...) from the git bin directory to the CopSsh bin directory and it went away.

我也收到了这个错误。我尝试将 git.exe 以及相应的 dll(libiconv 等)从 git bin 目录复制到 CopSsh bin 目录,然后它就消失了。

回答by Dorin Laz?r

As explained here: http://christopherpeplin.com/2013/01/cygwin-git-https/the sasl libraries and the ca-certificates are missing. Install them by running the setup of cygwin, and installing libsasl2 and ca-certificates packages (the first is support for SSL and the second the root certificates that will be used for SSL authentication).

如此处所述:http: //christopherpeplin.com/2013/01/cygwin-git-https/ 缺少 sasl 库和 ca 证书。通过运行 cygwin 的设置并安装 libsasl2 和 ca-certificates 包来安装它们(第一个是支持 SSL,第二个是将用于 SSL 身份验证的根证书)。

回答by Andrei

Hi if you are talking about the following article: http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/

嗨,如果你在谈论以下文章:http: //www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/

Then try to modify the path. Just add add the following lines into \home\.bashrc : export PATH=$PATH:/cygdrive/d/programs/Git/bin:/cygdrive/d/programs/Git/libexec/git-core

然后尝试修改路径。只需将以下行添加到 \home\.bashrc 中: export PATH=$PATH:/cygdrive/d/programs/Git/bin:/cygdrive/d/programs/Git/libexec/git-core

Where d/programs/Git is a d:\programs\Git -- is a path to msysgit installation

其中 d/programs/Git 是 ad:\programs\Git -- 是 msysgit 安装路径

回答by Wayne Piekarski

I also found that git submodule update would fail on Cygwin due to another broken dependency, where you need to install the gettext package as well.

我还发现 git submodule update 在 Cygwin 上会由于另一个损坏的依赖项而失败,您还需要在其中安装 gettext 包。

http://cygwin.1069669.n5.nabble.com/Re-shared-object-file-not-found-with-git-submodule-update-init-recursive-in-Cygwin-64-bit-td104123.html

http://cygwin.1069669.n5.nabble.com/Re-shared-object-file-not-found-with-git-submodule-update-init-recursive-in-Cygwin-64-bit-td104123.html