ubuntu git 源码编译安装

来源:互联网 发布:幼儿绘画软件 编辑:程序博客网 时间:2024/05/27 21:47

ubuntu git 源码编译安装

git是流行的分布式版本控制系统,从ubuntu官网下载iso镜像安装完10.10 desktop版后,默认没有安装git客户端。

本文发布时最新的git版本是1.7.4.3

  1. 安装git依赖的工具和库
    sudo apt-get build-dep git-core git-doc

  2. 从github.com下载并解压git源码
    wget -O git-v1.7.4.3.tar.gz --no-check-certificate https://github.com/git/git/tarball/v1.7.4.3
    tar xf git-v1.7.4.3.tar.gz
    cd git-git-b3229df

  3. 编译
    make prefix=/usr/local all doc
    如果此时编译报错
    fatal error: openssl/ssl.h: No such file or directory
    说明ssl开发包还没安装,运行
    sudo apt-get install libssl-dev

  4. 安装
    sudo make prefix=/usr/local install install-doc install-html
安装完成后运行git --version测试
0 0