Show difference between two commits or branches

suggest change

To view difference between two branches:

git diff <branch1>..<branch2>

To view difference between two commits:

git diff <commitId1>..<commitId2>

To compare the working tree with a branch or commit:

git diff <branch-or-commit>

To view summary of changes:

git diff --stat <branch/commitId>

To list paths that differ between the working tree and a commit:

git diff --name-only <commitId>

To list paths that differ between the working tree and a branch:

git diff --name-only <branchName>

To limit that comparison to one folder:

git diff --name-only <commitId> <folder_path>

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents