git-revisions: format

This commit is contained in:
Rico Sta. Cruz 2015-09-10 12:32:35 +08:00
parent db9dfcb39b
commit 1bc7f878fb
1 changed files with 39 additions and 31 deletions

View File

@ -2,42 +2,50 @@
title: Git revisions title: Git revisions
--- ---
### Single commits ### Commits
- commits: | `dae68e1` | sha1 |
- `dae68e1` (sha1) {:.shortcuts}
- refs: ### References
- `HEAD` (ref)
- `master` (branch)
- `v1.0.0` (tag)
- `origin/master` (aka, *refs/remotes/origin/master*)
- `heads/master`
- `refs/heads/master`
- search back: | `HEAD` | reference |
- `master@{yesterday}` | `master` | branch |
- `master@{2}` (2nd prior value) | `v1.0.0` | tag |
- `master@{push}` (where *master* would push to) | `origin/master` | aka, *refs/remotes/origin/master* |
- `master^` (parent) | `heads/master` | aka, *refs/heads/master* |
- `master^2` (2nd parent, eg, what it merged) | `refs/heads/master` | ... |
- `master~5` (5 parents back) {:.shortcuts}
- `master^0` (this commit; disambiguates from tags)
- `v0.99.8^{tag}` (can be *commit*, *tag*, *tree*, *object*)
- `v0.99.8^{}` (defaults to *{tag}*)
- `:/fix bug` (searches commit messages)
- other:
- `HEAD:README`
- `0:README` (0 to 3)
### Ranges ### Searching back
- `master` (reachable parents from master) | `master@{yesterday}` | also *1 day ago*, etc |
- `^master` (exclude reachable parents from master) | `master@{2}` | 2nd prior value |
- `master..fix` (reachable from *fix* but not *master*) | `master@{push}` | where *master* would push to |
- `master...fix` (reachable from *fix* and *master*, but not both) | `master^` | parent commit |
- `HEAD^@` (parents of *HEAD*) | `master^2` | 2nd parent, eg, what it merged |
- `HEAD^!` (*HEAD*, then excluding parents's ancestors) | `master~5` | 5 parents back |
| `master^0` | this commit; disambiguates from tags |
| `v0.99.8^{tag}` | can be *commit*, *tag*, *tree*, *object* |
| `v0.99.8^{}` | defaults to *{tag}* |
| `:/fix bug` | searches commit messages |
{:.shortcuts}
### Other
| `HEAD:README` | ... |
| `0:README` | (0 to 3) ... |
{:.shortcuts}
## Ranges
| `master` | reachable parents from master |
| `^master` | exclude reachable parents from master |
| `master..fix` | reachable from *fix* but not *master* |
| `master...fix` | reachable from *fix* and *master*, but not both |
| `HEAD^@` | parents of *HEAD* |
| `HEAD^!` | *HEAD*, then excluding parents's ancestors |
{:.shortcuts}
### Ranges illustration ### Ranges illustration