安裝
Gitti 使用 Go 構建,可以通過 go install 安裝,也可以下載預編譯的二進位檔案。
以此為前提
- Git: 確保已安裝 Git 並將其添加到 PATH 中。
- 終端: 建議使用支持真彩色 (True Color) 的終端模擬器。
通過 Go 安裝
如果您已安裝 Go(建議版本 1.21+):
go install github.com/gohyuhan/gitti@latest
確保您的 $GOPATH/bin 在 $PATH 中,以便在任何地方運行 gitti。
macOS (curl 或 homebrew)
curl --proto "=https" -sSfL https://github.com/gohyuhan/gitti/releases/latest/download/install.sh | bash
# 透過 homebrew
# 新增 tap (僅需一次)
brew tap gohyuhan/gitti
# 安裝最新版
brew update && brew install gitti
Linux
curl --proto "=https" -sSfL https://github.com/gohyuhan/gitti/releases/latest/download/install.sh | bash
Windows (PowerShell 或 scoop)
powershell -c "irm https://github.com/gohyuhan/gitti/releases/latest/download/install.ps1 | iex"
# 透過 scoop
# 新增 bucket (僅需一次)
scoop bucket add gitti https://github.com/gohyuhan/scoop-gitti
# 安裝最新版
scoop update; scoop install gitti
從源碼構建
-
克隆倉庫:
git clone [email protected]:gohyuhan/gitti.git
cd gitti -
構建二進位檔案:
go build -o gitti . -
移動到 PATH 中的目錄(非必要):
mv gitti /usr/local/bin/
驗證
運行以下命令以驗證安裝:
gitti --version