簡體中文 ▾
主題 ▾
最新版本 ▾ git-merge-index 最後更新於 2.35.0
git-merge-index 手冊的變更
設定和配置
獲取和建立專案
基本快照
分支與合併
共享和更新專案
檢查和比較
打補丁
除錯
電子郵件
外部系統
伺服器管理
指南
管理
底層命令
- 2.35.1 → 2.50.1 無更改
-
2.35.0
2022-01-24
- 2.24.1 → 2.34.8 無變更
-
2.24.0
2019-11-04
- 2.1.4 → 2.23.4 無變更
-
2.0.5
2014-12-17
描述
此命令會在索引中查詢 <file>(s),如果存在任何合併條目,則將這些檔案的 SHA-1 雜湊值作為引數 1、2、3 (如果檔案不存在則為空引數) 傳遞,並將 <file> 作為引數 4 傳遞。這三個檔案的檔案模式作為引數 5、6 和 7 傳遞。
選項
如果 git merge-index 被呼叫時帶有多個 <file>s (或 -a),它會依次處理它們,僅當合並返回非零退出程式碼時才停止。
通常,這會透過一個指令碼執行,該指令碼呼叫 Git 對 RCS 包中 merge 命令的模擬。
發行版中包含一個名為 git merge-one-file 的示例指令碼。
警告!警告!警告!Git 的“合併物件順序”與 RCS merge 程式的合併物件順序不同。在上述排序中,原始檔案位於第一位。但三方合併程式 merge 的引數順序是讓原始檔案位於中間。別問我為什麼。
示例
torvalds@ppc970:~/merge-test> git merge-index cat MM This is MM from the original tree. # original This is modified MM in the branch A. # merge1 This is modified MM in the branch B. # merge2 This is modified MM in the branch B. # current contents
或
torvalds@ppc970:~/merge-test> git merge-index cat AA MM cat: : No such file or directory This is added AA in the branch A. This is added AA in the branch B. This is added AA in the branch B. fatal: merge program failed
其中後一個示例展示了 git merge-index 一旦有任何操作返回錯誤就會停止嘗試合併(即,cat
對 AA 檔案返回了錯誤,因為它在原始檔案中不存在,因此 git merge-index 甚至沒有嘗試合併 MM 檔案)。