如何在 Debian Wheezy 上安装 git 1.8 或更高版本

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

How to install git 1.8 or above on Debian Wheezy

gitdebian

提问by Tarkan

I'm trying trying to install a later version of git (primarily 1.8.* or above). if I try and install it using apt-get install gitI end up installing version 1.7.10.4.

我正在尝试安装更高版本的 git(主要是 1.8.* 或更高版本)。如果我尝试使用安装它,apt-get install git我最终会安装 version 1.7.10.4

I have already tried changing the repository using the method below:

我已经尝试使用以下方法更改存储库:

add-apt-repository ppa:git-core/ppa
apt-get update
apt-get install git

The output of apt-get updatejust gives the me the following and because of that, I end up installing version 1.7.10.4again.

的输出apt-get update只是给了我以下内容,因此,我最终1.7.10.4再次安装了版本。

W: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/wheezy/main/source/Sources  404  Not Found
W: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/wheezy/main/binary-amd64/Packages  404  Not Found

I have also tried to install git using a backport, like the following:

我还尝试使用 backport 安装 git,如下所示:

sudo apt-get install git/wheezy-backports
sudo apt-get -t wheezy-backports install git

I never end up getting further than apt-get install git/wheezy-backportsbecause then I end up getting the following error:

我从来没有走得更远,apt-get install git/wheezy-backports因为我最终收到以下错误:

E: Release 'wheezy-backports' for 'git' was not found

How would I install git 1.8.* or above on Debian Wheezy?

我如何在 Debian Wheezy 上安装 git 1.8.* 或更高版本?

回答by Gheesh

I would definitely recommend using the backports version. To use the backports repository, keep in mind that you must add the following line to your /etc/apt/sources.list:

我绝对会推荐使用 backports 版本。要使用 backports 存储库,请记住您必须将以下行添加到您的 /etc/apt/sources.list:

deb http://http.debian.net/debian wheezy-backports main

And then you can retry with apt-get. You will find full instructions at http://backports.debian.org/Instructions/#index2h2

然后你可以用 apt-get 重试。您可以在http://backports.debian.org/Instructions/#index2h2找到完整的说明

回答by sorin

Let me provide a clean copy/paste solution:

让我提供一个干净的复制/粘贴解决方案:

echo "deb http://http.debian.net/debian wheezy-backports main" >/etc/apt/sources.list.d/wheezy-backports.list
sudo apt-get update -qq
sudo apt-get -t wheezy-backports install -y -qq git mercurial

回答by Philip Daniels

Clone it from its repo https://github.com/git/gitand compile it yourself. I've done it on Cygwin and it was easy, so it should be OK on Debian. Read the INSTALL file, it is fairly self-explanatory.

从它的 repo https://github.com/git/git克隆它并自己编译它。我已经在 Cygwin 上完成了,而且很容易,所以在 Debian 上应该没问题。阅读 INSTALL 文件,它是不言自明的。

If you haven't compiled software before you should know that there will be quite a few pre-requisites required (they are listed in the INSTALL). You should just be able to apt-getthem.

如果您之前没有编译过软件,您应该知道需要很多先决条件(它们列在 INSTALL 中)。你应该能够对apt-get他们。