]>
Commit | Line | Data |
---|---|---|
6be6b171 PB |
1 | List commits that are reachable by following the `parent` links from the |
2 | given commit(s), but exclude commits that are reachable from the one(s) | |
3 | given with a '{caret}' in front of them. The output is given in reverse | |
4 | chronological order by default. | |
5 | ||
6 | You can think of this as a set operation. Commits reachable from any of | |
7 | the commits given on the command line form a set, and then commits reachable | |
8 | from any of the ones given with '{caret}' in front are subtracted from that | |
9 | set. The remaining commits are what comes out in the command's output. | |
10 | Various other options and paths parameters can be used to further limit the | |
11 | result. | |
12 | ||
13 | Thus, the following command: | |
14 | ||
bea86658 | 15 | ifdef::git-rev-list[] |
6be6b171 PB |
16 | ----------------------------------------------------------------------- |
17 | $ git rev-list foo bar ^baz | |
18 | ----------------------------------------------------------------------- | |
bea86658 PB |
19 | endif::git-rev-list[] |
20 | ifdef::git-log[] | |
21 | ----------------------------------------------------------------------- | |
22 | $ git log foo bar ^baz | |
23 | ----------------------------------------------------------------------- | |
24 | endif::git-log[] | |
6be6b171 PB |
25 | |
26 | means "list all the commits which are reachable from 'foo' or 'bar', but | |
27 | not from 'baz'". | |
28 | ||
29 | A special notation "'<commit1>'..'<commit2>'" can be used as a | |
30 | short-hand for "^'<commit1>' '<commit2>'". For example, either of | |
31 | the following may be used interchangeably: | |
32 | ||
bea86658 | 33 | ifdef::git-rev-list[] |
6be6b171 PB |
34 | ----------------------------------------------------------------------- |
35 | $ git rev-list origin..HEAD | |
36 | $ git rev-list HEAD ^origin | |
37 | ----------------------------------------------------------------------- | |
bea86658 PB |
38 | endif::git-rev-list[] |
39 | ifdef::git-log[] | |
40 | ----------------------------------------------------------------------- | |
41 | $ git log origin..HEAD | |
42 | $ git log HEAD ^origin | |
43 | ----------------------------------------------------------------------- | |
44 | endif::git-log[] | |
6be6b171 PB |
45 | |
46 | Another special notation is "'<commit1>'...'<commit2>'" which is useful | |
47 | for merges. The resulting set of commits is the symmetric difference | |
48 | between the two operands. The following two commands are equivalent: | |
49 | ||
bea86658 | 50 | ifdef::git-rev-list[] |
6be6b171 PB |
51 | ----------------------------------------------------------------------- |
52 | $ git rev-list A B --not $(git merge-base --all A B) | |
53 | $ git rev-list A...B | |
54 | ----------------------------------------------------------------------- | |
bea86658 PB |
55 | endif::git-rev-list[] |
56 | ifdef::git-log[] | |
57 | ----------------------------------------------------------------------- | |
58 | $ git log A B --not $(git merge-base --all A B) | |
59 | $ git log A...B | |
60 | ----------------------------------------------------------------------- | |
61 | endif::git-log[] |