git-revisions: add examples
This commit is contained in:
parent
e1e3172552
commit
9e1c058685
|
@ -44,6 +44,7 @@ title: Git revisions
|
||||||
| `master...fix` | reachable from *fix* and *master*, but not both |
|
| `master...fix` | reachable from *fix* and *master*, but not both |
|
||||||
| `HEAD^@` | parents of *HEAD* |
|
| `HEAD^@` | parents of *HEAD* |
|
||||||
| `HEAD^!` | *HEAD*, then excluding parents's ancestors |
|
| `HEAD^!` | *HEAD*, then excluding parents's ancestors |
|
||||||
|
| `HEAD^{:/fix}` | search previous *HEAD*s matching criteria |
|
||||||
{:.shortcuts}
|
{:.shortcuts}
|
||||||
|
|
||||||
### Ranges illustration
|
### Ranges illustration
|
||||||
|
@ -55,3 +56,13 @@ A -+- E - F - G master
|
||||||
master..fix = BCD
|
master..fix = BCD
|
||||||
master...fix = BCD and EFG
|
master...fix = BCD and EFG
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Example usages
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git log master...develop # inspect differences in branches
|
||||||
|
git rebase -i HEAD~3 # rebase last 3 commits
|
||||||
|
git reset --hard HEAD@{2} # undo last operation that changed HEAD
|
||||||
|
git show ":/fix bug" # search commit with regex
|
||||||
|
git checkout v2^{} # checkout the `v2` tag (not `v2` branch)
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue