Git/版本差异

来自康健生活
< Git
Kangkk​(留言 | 贡献)2024年3月1日 (五) 06:42的版本 (创建页面,内容为“== diff == 任意两个版本的差异 {{shc|<syntaxhighlight lang="bash"> git diff master..test</syntaxhighlight>|$}} master , test 的共有父分支和 test 分支之间的差异 {{shc|<syntaxhighlight lang="bash"> git diff master...test</syntaxhighlight>|$}} 当前工作目录和上次提交与本地索引间的差异 {{shc|<syntaxhighlight lang="bash"> git diff</syntaxhighlight>|$}} 查看在下次提交时要提交的内容,显示当前的索引和上…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

diff

任意两个版本的差异

 
git diff master..test

master , test 的共有父分支和 test 分支之间的差异

 
git diff master...test

当前工作目录和上次提交与本地索引间的差异

 
git diff

查看在下次提交时要提交的内容,显示当前的索引和上次提交间的差异

 
git diff --cached

显示工作目录与上次提交时之间的所有差别

 
git diff HEAD