安裝前準備
autoconf
安裝 git 時, 會需要 autoconf 生成 configure 檔。
因此沒有 autoconf 的話,則需要事先安裝。 ,Ubuntu 可以如下安裝
>>> sudo apt-get install autoconf
一些必要的函式庫
- curl
- zlib
- openssl
- expat
- libiconv
Ubuntu 可透過 apt-get install 取得
>>> apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \ libz-dev libssl-dev
Downloadgit source code
在該網頁裡頭, 有一個前往 Git source repository 的連結。
它的 source code 是在放 github 裡頭, 要下載它,點選網頁左上方 ZIP 的按鈕,就可以下載 zip 壓縮檔。
開始安裝
基本上, 如何安裝, 在壓縮檔裡頭的 README 或 INSTALL 的文件都會描述得很清楚。
- Step 1
解壓縮 zip 檔
>>> unzip git-git-v1.7.12-rc0-22-gcdd159b.zip >>> cd git-git-cdd159b
Step 2 安裝在家目錄下的 min-sandbox/git 資料夾
>>> make configure >>> ./configure --prefix=/home/ming/min-sandbox/git >>> make all doc >>> make install install-doc install-html
不過實際上我是這樣安裝
>>> make configure >>> ./configure --prefix=/home/ming/min-sandbox/git >>> make install
make all doc 會產生說明文件, 電腦需要有先安裝過 AsciiDoc,否則這個步驟會出錯。
由於我沒有想要建立說明文件的需求, 就沒有特別再去安裝。
如果想要安裝,可參考:
- Setting up the Git documentation build chain on Mac OS X Leopard
- https://wincent.com/wiki/Setting_up_the_Git_documentation_build_chain_on_Mac_OS_X_Leopard
- git 源代码下载和安装(CentOS)
- http://dvbing.blog.163.com/blog/static/164830269201052651939613/
Step 3 (Option) 將安裝好的 /home/min/min-sandbox/git/bin 加入環境變數 PATH。
>>> export PATH=/home/ming/min-sandbox/git/bin:$PATH
或者是 設定 .bashrc
>>> echo 'export PATH=/home/ming/min-sandbox/git/bin:$PATH' > ~/.bashrc
其他安裝方式
比較輕鬆的安裝方式是透過 套件管理程式 。
Ubuntu 使用 apt-get install
>>> apt-get install git-core
只要一行就可以安裝 (可能會需要 sudo 的權限)。
與標題無關 AsciiDoc
- AsciiDoc 介紹
- AsciiDoc Home Page
- http://www.methods.co.nz/asciidoc/index.html
- 輕量級標記語言 - AsciiDoc, Markdown, reStructuredText
- http://coder.aqualuna.me/2011/10/asciidoc-markdown-restructuredtext.html
- AsciiDoc:文档格式化工具
- http://linuxtoy.org/archives/asciidoc.html
- AsciiDoc 入门
- http://1.sunchunman.sinaapp.com/?p=260
- AsciiDoc 簡介
- http://www.methods.co.nz/asciidoc/index.html