git diff 指令

顯示變動的內容

使用情境

  • 檢查更動
  • 判斷該文件是否發成衝突,或者解決衝突是否成功。
  • git diff 用在衝突檔案時,只會顯示衝突的部分,而不會顯示只有一邊修改的部分。

常用範例

範例 說明
git diff 比對所有差異
git diff a.txt 比對指定檔案的差異

語法結構

usage: git diff [<options>] [<commit> [<commit>]] [--] [<path>...]

results matching ""

    No results matching ""