ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## 从源代码开始安装 如果你在一个其基于Unix的系统中,你可以从Git的官网上[Git Download Page](http://git-scm.com/download)下载它的源代码,并运行像下面的几行命令,你就可以安装: ~~~ $ make prefix=/usr all ;# as yourself $ make prefix=/usr install ;# 以root权限运行 ~~~ 你需一些库: [expat](http://expat.sourceforge.net/),[curl](http://curl.linux-mirror.org/), [zlib](http://www.zlib.net/), 和 [openssl](http://www.openssl.org/); 除了expat 外,其它的可能在你的机器上都安装了。 ## Linux 如果你用的是Linux,你可以用你的本地包管理系统(native package management system)来安装. ~~~ $ yum install git-core #译者注,在redhat等系统下用yum $ apt-get install git-core #译者注,在debian, ubuntu等系统下用apt-get ~~~ 如果你用上面的命令不起作用的话,你可以从下面两个站点下载 .deb 或 .rpm 包: [RPM Packages](http://kernel.org/pub/software/scm/git/RPMS/) [Stable Debs](http://www.backports.org/debian/pool/main/g/git-core/) 如果你在Linux兴趣从源代码开始安装的话,下面的这篇文章也许对你有帮助: [Article: Installing Git on Ubuntu](http://chrisolsen.org/2008/03/10/installing-git-on-ubuntu/) ## Mac 10.4 在Mac10.4和 10.5,如果你安装了MacPorts,你可以通过 [MacPorts](http://www.macports.org/)来安装Git。如果你没有安装MacPort, 你可以从 [这里](http://www.macports.org/install.php)来安装它. 当你安装好MacPorts后,你可通过下面的命令来安装: ~~~ $ sudo port install git-core ~~~ 如果你想从源代码开始安装,下面这些文章可能对你有帮助: [Article: Installing Git on Tiger](http://rails.wincent.com/wiki/Installing_Git_1.5.2.3_on_Mac_OS_X_Tiger) [Article: Installing Git and git-svn on Tiger from source](http://larrytheliquid.com/2007/12/29/compiling-git-and-git-svn-on-osx-tiger/) ## Mac 10.5 在Leopard系统下,你也可以通过MacPorts来安装,但是你有一个新的选项:"一个漂亮的安装包", 你可以从这里来下载:[Git OSX Installer](http://code.google.com/p/git-osx-installer/downloads/list?can=3) 如果你想从源代码开始安装,我希望下面些资料能对你有帮助: [Article: Installing Git on OSX Leopard](http://solutions.treypiepmeier.com/2008/02/25/installing-git-on-os-x-leopard/) [Article: Installing Git on OS 10.5](http://dysinger.net/2007/12/30/installing-git-on-mac-os-x-105-leopard/) ## Windows 在Windows下安装Git是很简单的,你只要下载[msysGit](http://code.google.com/p/msysgit/downloads/list)就可以了。 _Git on Windows_ 这一章有一个"screencast"来在演示如何在windows下使用Git。