红穆笔记

git commit-tree

用於創建提交對象的底層工具。 另請參閱:`git commit`

100% 瀏覽器本地處理 0 數據上傳

常用示例

創建帶有指定提交信息的提交對象

git commit-tree {{樹對象哈希}} -m "{{提交信息}}"

從文件讀取提交信息創建提交對象(使用 `-` 表示從標準輸入讀取)

git commit-tree {{樹對象哈希}} -F {{路徑/到/文件}}

創建 GPG 簽名過的提交對象

git commit-tree {{樹對象哈希}} -m "{{提交信息}}" {{[-S|--gpg-sign]}}

創建指定父提交的提交對象

git commit-tree {{樹對象哈希}} -m "{{提交信息}}" -p {{父提交哈希}}

提示:花括號{{…}}是需要替換的參數(路徑、文件名等);命令只在本機終端執行,本站不保存任何輸入。

英文原文對照

展開英文說明與示例(來源 tldr-pages)

Low level utility to create commit objects. See also: `git commit`. More information

Create a commit object with the specified message

git commit-tree {{tree}} -m "{{message}}"

Create a commit object reading the message from a file (use `-` for `stdin`)

git commit-tree {{tree}} -F {{path/to/file}}

Create a GPG-signed commit object

git commit-tree {{tree}} -m "{{message}}" {{[-S|--gpg-sign]}}

Create a commit object with the specified parent commit object

git commit-tree {{tree}} -m "{{message}}" -p {{parent_commit_sha}}

命令信息

命令名git commit-tree
用途用於創建提交對象的底層工具。 另請參閱:`git commit`
適用平臺通用
示例數量4 條
官方文檔https://git-scm.com/docs/git-commit-tree
數據來源tldr-pages(CC-BY-4.0)· 社區中文翻譯

常見問題

git commit-tree 命令是做什麼的?

用於創建提交對象的底層工具。 另請參閱:`git commit`

git commit-tree 怎麼用?

頁面按場景列出了4 條常用示例:每條示例先說明用途,再給出可直接複製的完整命令(花括號裏是需要替換的參數)。

git commit-tree 最常用的操作是什麼?

創建帶有指定提交信息的提交對象:git commit-tree {{樹對象哈希}} -m "{{提交信息}}"

命令裏的花括號是什麼意思?

花括號{{…}}表示需要替換成你自己的值,例如路徑、文件名;同名參數方括號(如 [-C|--directory])表示可選寫法。