Difference between revisions of "Git/diff"
< Git
Jump to navigation
Jump to search
(Created page with "==About== '''git diff''' lets you see the differences between current edits and the last commit. <code>git diff --staged</code> will show the differences between staged files...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
'''git diff''' lets you see the differences between current edits and the last commit. | '''git diff''' lets you see the differences between current edits and the last commit. | ||
− | <code>git diff --staged</code> will show the differences between staged files and the last commit. | + | * <code>git diff --staged</code> will show the differences between staged files and the last commit. |
+ | * <code>git diff {{arg|branch 1}} {{arg|branch 2}}</code> will show the differences between <code>branch 1</code> and <code>branch 2</code>. | ||
+ | * <code>git diff {{arg|other branch}}</code> will show the differences between <code>other branch</code> and the current branch. | ||
− | See also [[git | + | See also [[../status|git status]], which just lists files that have changed. |
+ | ==Links== | ||
+ | ===Documentation=== | ||
+ | * {{l/manpage|git-diff|manpage @ HTYP}} | ||
+ | * [https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-diff.html manpage @ kernel.org] |
Latest revision as of 12:42, 6 November 2018
About
git diff lets you see the differences between current edits and the last commit.
git diff --staged
will show the differences between staged files and the last commit.git diff <branch 1> <branch 2>
will show the differences betweenbranch 1
andbranch 2
.git diff <other branch>
will show the differences betweenother branch
and the current branch.
See also git status, which just lists files that have changed.