Skip to content

Commit 6ca224f

Browse files
committed
Merge branch 'dl/diff-merge-base'
"git diff --merge-base" documentation has been updated. * dl/diff-merge-base: git-diff: fix missing --merge-base docs
2 parents dd6d3c9 + eb44863 commit 6ca224f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Documentation/git-diff.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,20 @@ files on disk.
5151
--staged is a synonym of --cached.
5252
+
5353
If --merge-base is given, instead of using <commit>, use the merge base
54-
of <commit> and HEAD. `git diff --merge-base A` is equivalent to
55-
`git diff $(git merge-base A HEAD)`.
54+
of <commit> and HEAD. `git diff --cached --merge-base A` is equivalent to
55+
`git diff --cached $(git merge-base A HEAD)`.
5656

57-
'git diff' [<options>] <commit> [--] [<path>...]::
57+
'git diff' [<options>] [--merge-base] <commit> [--] [<path>...]::
5858

5959
This form is to view the changes you have in your
6060
working tree relative to the named <commit>. You can
6161
use HEAD to compare it with the latest commit, or a
6262
branch name to compare with the tip of a different
6363
branch.
64+
+
65+
If --merge-base is given, instead of using <commit>, use the merge base
66+
of <commit> and HEAD. `git diff --merge-base A` is equivalent to
67+
`git diff $(git merge-base A HEAD)`.
6468

6569
'git diff' [<options>] [--merge-base] <commit> <commit> [--] [<path>...]::
6670

builtin/diff.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
static const char builtin_diff_usage[] =
2828
"git diff [<options>] [<commit>] [--] [<path>...]\n"
29-
" or: git diff [<options>] --cached [<commit>] [--] [<path>...]\n"
30-
" or: git diff [<options>] <commit> [--merge-base] [<commit>...] <commit> [--] [<path>...]\n"
29+
" or: git diff [<options>] --cached [--merge-base] [<commit>] [--] [<path>...]\n"
30+
" or: git diff [<options>] [--merge-base] <commit> [<commit>...] <commit> [--] [<path>...]\n"
3131
" or: git diff [<options>] <commit>...<commit>] [--] [<path>...]\n"
3232
" or: git diff [<options>] <blob> <blob>]\n"
3333
" or: git diff [<options>] --no-index [--] <path> <path>]\n"

0 commit comments

Comments
 (0)