如何在cygwin上构建和使用最新版本的git? [英] How do I build and use the latest version of git on cygwin?

查看:196
本文介绍了如何在cygwin上构建和使用最新版本的git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

至于为什么要这样做,请参阅这个问题:使用cygwin官方Windows Git二进制文件的缺点是什么?

As for why I'd want to do this, see this question: What are the downsides to using the official Windows Git binaries from cygwin?

或者你可以看看这: http: //git.661346.n2.nabble.com/Fwd-Error-with-git-svn-pushing-a-rename-td7599382.html 它阻止您将重命名的文件推送到svn服务器。

Or you could look at this: http://git.661346.n2.nabble.com/Fwd-Error-with-git-svn-pushing-a-rename-td7599382.html It prevents you from pushing renamed files to the svn server.

Cygwin停留在一个版本的git,当与git-svn桥一起使用时有许多bug。很多这些已经修复在最新的git(他们的主分支,而不是可下载的)。那么如何获得,构建和使用它呢?

Cygwin is stuck at a version of git that has numerous bugs when used with the git-svn bridge. A lot of these have been fixed in the latest git (their master branch, not the one available for download). So how do you get, build and use it?

我将在下面回答。

推荐答案

,您将需要安装几个必需的软件包。我将假设你知道如何通过使用他们的setup.exe在cygwin上安装的东西。这里是你需要安装:

To compile git, you're going to need to install a few required packages. I'm going to assume you know how to install things on cygwin by using their setup.exe. Here's what you need to install:

git (you need git to get git source)
make
gcc-core
libcurl-devel
openssl-devel
subversion-perl
dos2unix
libiconv
libiconv-devel
gettext
expat
gettext-devel
expat-devel

git clone https://kernel.googlesource.com/pub/scm/git/git.git
cd git

现在由于某种原因我不明白,我必须将所有文件转换为unix行结尾。我不明白为什么他们没有这样来。我这样做:

Now for some reason I don't understand, I have to convert all the files to have unix line endings. I don't understand why they didn't already come that way. I did that with this:

find . -type f | xargs dos2unix

最后,我做了这些步骤:

Finally I did these steps:

  make -j8
  make test; # optional, to verify that the git you built works ok
  export PATH=$(pwd)/bin-wrappers:$PATH

git二进制文件在 ./ bin-wrappers 中。您可能希望将该目录永久添加到路径中。

The git binaries are in ./bin-wrappers. You probably want to permanently add that directory to your path.

这篇关于如何在cygwin上构建和使用最新版本的git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆