git 命令用於管理源代碼版本。
git clone git://code.qt.io/pyside/pyside-setup.git
基本語法
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>]
command 命令
功能 | 參數 | EN 解釋 | 中文翻譯 | 備注 |
---|---|---|---|---|
存儲庫 | clone | Clone a repository into a new directory | 把存儲庫剋隆進新目錄 | |
init | Create an empty Git repository or reinitialize an existing one | 創建空 Git 存儲庫 (或重新初始化現有的) | ||
remote | Manage set of tracked repositories | 管理跟蹤存儲庫集 | ||
進棧 | push | Update remote refs along with associated objects | 隨關聯對象更新遠程引用 | |
send-pack | Push objects over Git protocol to another repository | 透過 Git 協議把對象壓入另一存儲庫 | ||
引用 | for-each-ref | Output information on each ref | 輸齣每個引用的信息 | |
reflog | Manage reflog information | 管理引用日誌信息 | ||
replace | Create, list, delete refs to replace objects | 創建 列齣 刪除引用以替換對象 | ||
show-ref | List references in a local repository | 列齣本地存儲庫中的引用 | ||
symbolic-ref | Read, modify and delete symbolic refs | 讀取 修改和刪除符號引用 | ||
更新 | submodule | Initialize, update or inspect submodules | 初始化 更新 (或檢查) 子模塊 | |
update-index | Register file contents in the working tree to the index | 把工作樹中的文件內容注冊到索引 | ||
update-ref | Update the object name stored in a ref safely | 更新存儲在安全引用中的對象名稱 | ||
獲取 | fetch | Download objects and refs from another repository | 從另一存儲庫下載對象和引用 | |
fetch-pack | Receive missing objects from another repository | 從另一存儲庫接收缺失對象 | ||
pull | Fetch from and integrate with another repository or a local branch | 從另一存儲庫 (或本地分支) 取得並與之集成 | ||
簽齣 | checkout | Switch branches or restore working tree files | 切換分支 (或恢復工作樹文件) | |
checkout-index | Copy files from the index to the working tree | 把文件從索引拷貝到工作樹 | ||
分支 | branch | List, create, or delete branches | 列齣 創建 (或刪除) 分支 | |
filter-branch | Rewrite branches | 重寫分支 | ||
quiltimport | Applies a quilt patchset onto the current branch | 把被子補丁集應用到當前分支 | ||
show-branch | Show branches and their commits | 展示分支及其提交 | ||
消息 | fmt-merge-msg | Produce a merge commit message | 産生閤並提交消息 | |
interpret-trailers | add or parse structured information in commit messages | 在提交消息中,添加或解析結構化信息 | ||
閤並 | merge | Join two or more development histories together | 把兩個 (或多個) 開發曆史聯結到一起 | |
merge-base | Find as good common ancestors as possible for a merge | 盡可能查找好的共同祖先進行閤並 | ||
merge-file | Run a three-way file merge | 運行 3 路文件閤並 | ||
merge-index | Run a merge for files needing merging | 運行需要閤並的文件的閤並 | ||
merge-one-file | The standard helper program to use with git-merge-index | 與 git-merge-index 一起使用的標準幫助程序 | ||
merge-tree | Show three-way merge without touching index | 展示不會觸及索引的 3 路閤並 | ||
mergetool | Run merge conflict resolution tools to resolve merge conflicts | 運行閤並衝突解決工具,以解決閤並衝突 | ||
rerere | Reuse recorded resolution of conflicted merges | 重用記錄的衝突閤並解決方案 | ||
索引 | add | Add file contents to the index | 把文件內容添加到索引 | |
index-pack | Build pack index file for an existing packed archive | 為現有打包存檔構建包索引文件 | ||
multi-pack-index | Write and verify multi-pack-indexes | 編寫並驗證多包索引 | ||
rm | Remove files from the working tree and from the index | 從工作樹和索引移除文件 | ||
show-index | Show packed archive index | 展示打包存檔索引 | ||
編輯 | gc | Cleanup unnecessary files and optimize the local repository | 清理不必要的文件並優化本地存儲庫 | |
mv | Move or rename a file, a directory, or a symlink | 移動 (或重命名) 文件 目錄 (或符號鏈接) | ||
reset | Reset current HEAD to the specified state | 把當前 HEAD 重置到指定狀態 | ||
審查曆史和狀態 | bisect | Use binary search to find the commit that introduced a bug | 使用二進製搜索,去查找引入 Bug 的提交 | |
fsck | Verifies the connectivity and validity of the objects in the database | 驗證數據庫中對象的連接性和有效性 | ||
grep | Print lines matching a pattern | 打印匹配模式的行 | ||
show | Show various types of objects | 展示對象的各種類型 | ||
日誌 | log | Show commit logs | 展示提交日誌 | |
notes | Add or inspect object notes | 添加 (或檢查) 對象筆記 | ||
shortlog | Summarize 'git log' output | 摘要 Git 日誌輸齣 | ||
注解 | annotate | Annotate file lines with commit information | 以提交信息注解文件行 | |
blame | Show what revision and author last modified each line of a file | 展示上次修改文件每一行的修訂版和作者 | ||
cat-file | Provide content or type and size information for repository objects | 提供存儲庫對象的內容或類型和大小信息 | ||
count-objects | Count unpacked number of objects and their disk consumption | 計數未打包對象數及其磁盤消耗 | ||
help | Display help information about Git | 顯示有關 Git 的幫助信息 | ||
標簽 | mktag | Creates a tag object | 創建標簽對象 | |
tag | Create, list, delete or verify a tag object signed with GPG | 創建 列齣 刪除 (或驗證) 具有 GPG 簽名的標簽對象 | ||
verify-commit | Check the GPG signature of commits | 校驗提交的 GPG 簽名 | ||
verify-tag | Check the GPG signature of tags | 校驗標簽的 GPG 簽名 | ||
提交 | commit | Record changes to the repository | 把變化記錄到存儲庫 | |
commit-graph | Write and verify Git commit-graph files | 編寫並驗證 Git 提交圖形文件 | ||
commit-tree | Create a new commit object | 創建新提交對象 | ||
get-tar-commit-id | Extract commit ID from an archive created using git-archive | 從使用 git-archive 創建的存檔中提取提交 ID | ||
差異 | diff | Show changes between commits, commit and working tree, etc | 展示提交 (提交和工作樹等) 之間的變化 | |
diff-files | Compares files in the working tree and the index | 比較工作樹和索引中的文件 | ||
diff-index | Compare a tree to the working tree or index | 把樹與工作樹 (或索引) 進行比較 | ||
diff-index | Compare a tree to the working tree or index | 把樹與工作樹 (或索引) 進行比較 | ||
diff-tree | Compares the content and mode of blobs found via two tree objects | 通過比較 2 樹對象,發現斑點的內容和模式 | ||
cherry | cherry | Find commits yet to be applied to upstream | 查找尚未被應用於上遊的提交 | |
cherry-pick | Apply the changes introduced by some existing commits | 應用由一些現有提交引入的變化 | ||
變化 | citool | Graphical alternative to git-commit | git-commit 的圖形替代 | |
request-pull | Generates a summary of pending changes | 生成掛起變化的摘要 | ||
stash | Stash the changes in a dirty working directory away | 把變化藏匿在髒工作目錄中 | ||
whatchanged | Show logs with difference each commit introduces | 展示每次提交引入差異的日誌 | ||
修剪 | prune | Prune all unreachable objects from the object database | 修剪對象數據庫中的所有不可達對象 | |
prune-packed | Remove extra objects that are already in pack files | 移除已在包文件中的額外對象 | ||
微調 | range-diff | Compare two commit ranges (e.g. two versions of a branch) | 比較 2 提交範圍 (例如:分支的 2 版本) | |
rebase | Reapply commits on top of another base tip | 重新應用在另一基本提示之上的提交 | ||
存檔 | archive | Create an archive of files from a named tree | 從命名樹創建文件存檔 | |
archimport | Import a GNU Arch repository into Git | 把 GNU Arch 存儲庫導入 Git | ||
bundle | Move objects and refs by archive | 按存檔移動對象和引用 | ||
describe | Give an object a human readable name based on an available ref | 基於可用的引用給予對象人類可讀名稱 | ||
包 | pack-objects | Create a packed archive of objects | 創建打包對象存檔 | |
pack-redundant | Find redundant pack files | 查找冗餘包文件 | ||
pack-refs | Pack heads and tags for efficient repository access | 為高效訪問存儲庫打包頭和標簽 | ||
repack | Pack unpacked objects in a repository | 把未打包對象打包到存儲庫中 | ||
unpack-file | Creates a temporary file with a blob's contents | 創建具有斑點內容的臨時文件 | ||
unpack-objects | Unpack objects from a packed archive | 從打包存檔中解包對象 | ||
verify-pack | Validate packed Git archive files | 驗證打包的 Git 存檔文件 | ||
工作樹 | clean | Remove untracked files from the working tree | 從工作樹移除未跟蹤的文件 | |
mktree | Build a tree-object from ls-tree formatted text | 從 ls-tree 格式文本構建樹對象 | ||
read-tree | Reads tree information into the index | 把樹信息讀入索引 | ||
worktree | Manage multiple working trees | 管理多個工作樹 | ||
write-tree | Create a tree object from the current index | 從當前索引創建樹對象 | ||
status | Show the working tree status | 展示工作樹狀態 | ||
通信 | daemon | A really simple server for Git repositories | 非常簡單的 Git 存儲庫服務器 | |
http-backend | Server side implementation of Git over HTTP | Git 的 HTTP 服務器端實現 | ||
update-server-info | Update auxiliary info file to help dumb servers | 更新輔助信息文件,以幫助轉儲服務器 | ||
接口 | gitk | The Git repository browser | Git 存儲庫瀏覽器 | |
gitweb | Git web interface (web frontend to Git repositories) | Git Web 界麵 (Git 存儲庫的 Web 前端) | ||
gui | A portable graphical interface to Git | 可移植的 Git 圖形界麵 | ||
instaweb | Instantly browse your working repository in gitweb | 立即瀏覽 gitweb 中的工作存儲庫 | ||
反嚮 | name-rev | Find symbolic names for given revs | 查找給定 rev 的符號名稱 | |
rev-list | Lists commit objects in reverse chronological order | 按反嚮時間順序,列齣提交對象 | ||
rev-parse | Pick out and message parameters | 挑齣並消息參數 | ||
CVS | cvsexportcommit | Export a single commit to a CVS checkout | 將單個提交導齣到 CVS 簽齣 | |
cvsimport | Salvage your data out of another SCM people love to hate | 從讓人又愛又恨的另一 SCM 中搶救齣你的數據 | ||
cvsserver | A CVS server emulator for Git | 用於 Git 的 CVS 服務器模擬器 | ||
電子郵件 | am | Apply a series of patches from a mailbox | 從郵箱應用一係列補丁 | |
apply | Apply a patch to files and/or to the index | 把補丁應用到文件和/或索引 | ||
format-patch | Prepare patches for e-mail submission | 為電子郵件提交準備補丁 | ||
imap-send | Send a collection of patches from stdin to an IMAP folder | 把補丁集閤從標準輸入發送到 IMAP 文件夾 | ||
mailinfo | Extracts patch and authorship from a single e-mail message | 從單個電子郵件消息中,提取補丁和作者身份 | ||
mailsplit | Simple UNIX mbox splitter program | 簡單的 UNIX mbox 拆分器程序 | ||
patch-id | Compute unique ID for a patch | 計算補丁的唯一 ID | ||
send-email | Send a collection of patches as emails | 以電子郵件發送補丁集閤 | ||
導入 導齣 | fast-export | Git data exporter | Git數據導齣器 | |
fast-import | Backend for fast Git data importers | 快速 Git 數據導入器的後端 | ||
p4 | Import from and submit to Perforce repositories | 從 Perforce 存儲庫導入,並提交給 Perforce 存儲庫 | ||
svn | Bidirectional operation between a Subversion repository and Git | Subversion 存儲庫和 Git 之間的雙嚮操作 | ||
列錶 | ls-files | Show information about files in the index and the working tree | 展示有關索引文件和工作樹的信息 | |
ls-remote | List references in a remote repository | 列齣遠程存儲庫中的引用 | ||
ls-tree | List the contents of a tree object | 列齣樹對象的內容 | ||
校驗 | check-attr | Display gitattributes information | 顯示 gitattributes 信息 | |
check-ignore | Debug gitignore / exclude files | 調試 gitignore/排除文件 | ||
check-mailmap | Show canonical names and email addresses of contacts | 顯示聯係人的規範名稱和電子郵件地址 | ||
證書 | credential | Retrieve and store user credentials | 檢索和存儲用戶證書 | |
credential-cache | Helper to temporarily store passwords in memory | 把口令臨時存儲在內存中的幫助程序 | ||
credential-store | Helper to store credentials on disk | 把證書存儲在磁盤的幫助程序 | ||
Shell | sh-i18n | Git's i18n setup code for shell scripts | 用於 Shell 腳本的 Git i18n 設置代碼 | |
sh-setup | Common Git shell script setup code | 通用 Git Shell 腳本設置代碼 | ||
輔助 | config | Get and set repository or global options | 獲取並設置存儲庫 (或全局選項) | |
column | Display data in columns | 在列中顯示數據 | ||
hash-object | Compute object ID and optionally creates a blob from a file | 計算對象 ID 並可選地從文件創建斑點 | ||
stripspace | Remove unnecessary whitespace | 移除不必要的空格 | ||
var | Show a Git logical variable | 展示 Git 邏輯變量 |
功能 | 命令 | 文字解釋 | 示例 | 示例解釋 |
---|---|---|---|---|
幫助 | git --help | 展示幫助信息 | ||
git help -a | 展示所有幫助信息 | |||
git help -g | 展示所有指導教程列錶信息 | |||
版本 | git --version | 展示版本信息 |
版權聲明: 本文為獨傢原創稿件,版權歸 樂數軟件 ,未經許可不得轉載。