mac安裝中文版本 git

ponponon發表於2021-12-24
╰─➤  where git
/usr/bin/git
/opt/homebrew/bin/git

mac 自帶的 git 是英文的,使用 brew 安裝的 git 是中文的。

如果要安裝中文版本的 git 需要先安裝 brew ,再使用 brew 安裝 git

如果系統自帶的 git 在前面的話,就通過環境變數的設定換一下前後順序

git 英文版本

(CBIR) ╭─bot@mbp13m1.local ~/Desktop/code/work/CBIR  ‹feature/web_server*› 
╰─➤  git --help
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone             Clone a repository into a new directory
   init              Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add               Add file contents to the index
   mv                Move or rename a file, a directory, or a symlink
   restore           Restore working tree files
   rm                Remove files from the working tree and from the index
   sparse-checkout   Initialize and modify the sparse-checkout

examine the history and state (see also: git help revisions)
   bisect            Use binary search to find the commit that introduced a bug
   diff              Show changes between commits, commit and working tree, etc
   grep              Print lines matching a pattern
   log               Show commit logs
   show              Show various types of objects
   status            Show the working tree status

grow, mark and tweak your common history
   branch            List, create, or delete branches
   commit            Record changes to the repository
   merge             Join two or more development histories together
   rebase            Reapply commits on top of another base tip
   reset             Reset current HEAD to the specified state
   switch            Switch branches
   tag               Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch             Download objects and refs from another repository
   pull              Fetch from and integrate with another repository or a local branch
   push              Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.

git 中文版本

╰─➤  /opt/homebrew/bin/git --help
用法:git [--version] [--help] [-C <路徑>] [-c <名稱>=<取值>]
           [--exec-path[=<路徑>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<路徑>] [--work-tree=<路徑>] [--namespace=<名稱>]
           [--super-prefix=<路徑>] [--config-env=<名稱>=<環境變數>]
           <命令> [<引數>]

這些是各種場合常見的 Git 命令:

開始一個工作區(參見:git help tutorial)
   clone             克隆倉庫到一個新目錄
   init              建立一個空的 Git 倉庫或重新初始化一個已存在的倉庫

在當前變更上工作(參見:git help everyday)
   add               新增檔案內容至索引
   mv                移動或重新命名一個檔案、目錄或符號連結
   restore           恢復工作區檔案
   rm                從工作區和索引中刪除檔案
   sparse-checkout   初始化及修改稀疏檢出

檢查歷史和狀態(參見:git help revisions)
   bisect            通過二分查詢定位引入 bug 的提交
   diff              顯示提交之間、提交和工作區之間等的差異
   grep              輸出和模式匹配的行
   log               顯示提交日誌
   show              顯示各種型別的物件
   status            顯示工作區狀態

擴充套件、標記和調校您的歷史記錄
   branch            列出、建立或刪除分支
   commit            記錄變更到倉庫
   merge             合併兩個或更多開發歷史
   rebase            在另一個分支上重新應用提交
   reset             重置當前 HEAD 到指定狀態
   switch            切換分支
   tag               建立、列出、刪除或校驗一個 GPG 簽名的標籤物件

協同(參見:git help workflows)
   fetch             從另外一個倉庫下載物件和引用
   pull              獲取並整合另外的倉庫或一個本地分支
   push              更新遠端引用和相關的物件

命令 'git help -a' 和 'git help -g' 顯示可用的子命令和一些概念幫助。
檢視 'git help <命令>' 或 'git help <概念>' 以獲取給定子命令或概念的
幫助。
有關係統的概述,檢視 'git help git'。

相關文章