git diff fileName
查看文件工做區與暫存區的區別git diff --staged fileName
查看文件暫存區與最近一次提交的區別git diff HEAD fileName
查看文件工做區與最近一次提交的區別git diff commit-id fileName
查看文件工做區與指定的提交的區別git diff --staged commit-id fileName
查看暫存區與指定提交之間的區別git diff commit-id commit-id
查看指定提交之間的區別主要參考 git diff --help
下的文檔git