Skip to content

Commit d2d4c57

Browse files
committed
git-revisions: update some more
1 parent aa4eb50 commit d2d4c57

File tree

3 files changed

+81
-49
lines changed

3 files changed

+81
-49
lines changed

Diff for: _sass/2017/markdown/table.scss

+13
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,16 @@
143143
white-space: nowrap;
144144
}
145145
}
146+
147+
.MarkdownBody table.-mute-em {
148+
& td,
149+
& th {
150+
& em {
151+
opacity: 0.5;
152+
}
153+
154+
& em > code {
155+
margin-right: 0.5em;
156+
}
157+
}
158+
}

Diff for: cheatsheet-styles.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ See: [H3 sections](#h3-sections-1)
3737
| `-bold-first` | Bold first column |
3838
| `-headers` | Show headers |
3939
| `-left-align` | Don't right align last column |
40+
| `-mute-em` | Lower opacity for italics |
4041
| `-no-wrap` | Don't wrap text |
4142
| `-shortcuts` | Shortcut keys |
4243

Diff for: git-revisions.md

+67-49
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,75 @@ layout: 2017/sheet
55
updated: 2017-10-11
66
description: ""
77
intro: |
8-
A list of revision specifications you can use with `git log` and many other Git commands. Summarized from `man gitrevisions`.
8+
A list of revision specifications you can use with `git log` and many other Git commands. Summarized from `gitrevisions(7)` man page.
99
---
1010

1111
### Example usages
1212

13-
```bash
14-
git log master...develop # inspect differences in branches
15-
git rebase -i HEAD~3 # rebase last 3 commits
16-
git reset --hard HEAD@{2} # undo last operation that changed HEAD
17-
git show ":/fix bug" # search commit with regex
18-
git checkout v2^{} # checkout the `v2` tag (not `v2` branch)
19-
```
20-
The 3rd argument in each of these commands is a `gitrevision`.
13+
| _`git log`_ `master...develop` | inspect differences in branches |
14+
| _`git rebase -i`_ `HEAD~3` | rebase last 3 commits |
15+
| _`git reset --hard`_ `HEAD@{2}` | undo last operation that changed HEAD |
16+
| _`git checkout`_ `v2^{}` | checkout the `v2` tag (not `v2` branch) |
17+
{: .-mute-em}
18+
19+
The 3rd argument in each of these commands is a `gitrevision`. These gitrevisions can be passed to many Git commands.
2120

2221
### Common git revisions
2322

24-
| Reference | Description |
25-
| --- | --- |
26-
| `dae68e1` | sha1 |
27-
| `HEAD` | reference |
28-
| `v1.0.0` | tag |
29-
| --- | --- |
30-
| `master` | local branch |
31-
| `origin/master` | remote branch |
32-
| --- | --- |
33-
| `master~2` | 2 commits back from master |
34-
| --- | --- |
35-
| `master..fix` | reachable from *fix* but not *master* |
36-
| `master...fix` | reachable from *fix* and *master*, but not both |
37-
38-
These are just the common ones, there's a lot more below!
23+
| Reference | Description |
24+
| --- | --- |
25+
| _`git show`_ `dae68e1` | sha1 |
26+
| _`git show`_ `HEAD` | reference |
27+
| _`git show`_ `v1.0.0` | tag |
28+
| --- | --- |
29+
| _`git show`_ `master` | local branch |
30+
| _`git show`_ `origin/master` | remote branch |
31+
| --- | --- |
32+
| _`git show`_ `master~2` | 2 commits back from master |
33+
| --- | --- |
34+
| _`git show`_ `master..fix` | reachable from *fix* but not *master* |
35+
| _`git show`_ `master...fix` | reachable from *fix* and *master*, but not both |
36+
{: .-mute-em}
37+
38+
These are just the common ones, there's a lot more below! (These work in many other commands, not just `git show`.)
3939

4040
## Reference
4141

4242
### Commits
4343

44-
| `dae68e1` | sha1 |
44+
| _`git checkout`_ `dae68e1` | sha1 |
45+
{: .-mute-em}
4546

4647
### References
4748

48-
| `HEAD` | reference |
49-
| `master` | branch |
50-
| `v1.0.0` | tag |
51-
| `origin/master` | aka, *refs/remotes/origin/master* |
52-
| `heads/master` | aka, *refs/heads/master* |
49+
| Example | Description |
50+
| --- | --- |
51+
| _`git checkout`_ `HEAD` | reference |
52+
| _`git checkout`_ `master` | branch |
53+
| _`git checkout`_ `v1.0.0` | tag |
54+
| --- | --- |
55+
| _`git checkout`_ `origin/master` | aka, *refs/remotes/origin/master* |
56+
| _`git checkout`_ `heads/master` | aka, *refs/heads/master* |
57+
{: .-mute-em}
5358

5459
### Searching back
5560

56-
| `master@{yesterday}` | also *1 day ago*, etc |
57-
| `master@{2}` | 2nd prior value |
58-
| `master@{push}` | where *master* would push to |
59-
| `master^` | parent commit |
60-
| `master^2` | 2nd parent, eg, what it merged |
61-
| `master~5` | 5 parents back |
62-
| `master^0` | this commit; disambiguates from tags |
63-
| `v0.99.8^{tag}` | can be *commit*, *tag*, *tree*, *object* |
64-
| `v0.99.8^{}` | defaults to *{tag}* |
65-
| `:/fix bug` | searches commit messages |
61+
| Example | Description |
62+
| --- | --- |
63+
| _`git checkout`_ `master@{yesterday}` | also *1 day ago*, etc |
64+
| _`git checkout`_ `master@{2}` | 2nd prior value |
65+
| _`git checkout`_ `master@{push}` | where *master* would push to |
66+
| --- | --- |
67+
| _`git checkout`_ `master^` | parent commit |
68+
| _`git checkout`_ `master^2` | 2nd parent, eg, what it merged |
69+
| _`git checkout`_ `master~5` | 5 parents back |
70+
| _`git checkout`_ `master^0` | this commit; disambiguates from tags |
71+
| --- | --- |
72+
| _`git checkout`_ `v0.99.8^{tag}` | can be *commit*, *tag*, *tree*, *object* |
73+
| _`git checkout`_ `v0.99.8^{}` | defaults to *{tag}* |
74+
| --- | --- |
75+
| _`git checkout`_ `":/fix bug"` | searches commit messages |
76+
{: .-mute-em}
6677

6778
### Other
6879

@@ -73,13 +84,14 @@ These are just the common ones, there's a lot more below!
7384

7485
### Ranges
7586

76-
| `master` | reachable parents from master |
77-
| `^master` | exclude reachable parents from master |
78-
| `master..fix` | reachable from *fix* but not *master* |
79-
| `master...fix` | reachable from *fix* and *master*, but not both |
80-
| `HEAD^@` | parents of *HEAD* |
81-
| `HEAD^!` | *HEAD*, then excluding parents's ancestors |
82-
| `HEAD^{:/fix}` | search previous *HEAD*s matching criteria |
87+
| _`git log`_ `master` | reachable parents from master |
88+
| _`git log`_ `^master` | exclude reachable parents from master |
89+
| _`git log`_ `master..fix` | reachable from *fix* but not *master* |
90+
| _`git log`_ `master...fix` | reachable from *fix* and *master*, but not both |
91+
| _`git log`_ `HEAD^@` | parents of *HEAD* |
92+
| _`git log`_ `HEAD^!` | *HEAD*, then excluding parents's ancestors |
93+
| _`git log`_ `HEAD^{:/fix}` | search previous *HEAD*s matching criteria |
94+
{: .-mute-em}
8395

8496
### Ranges illustration
8597

@@ -90,5 +102,11 @@ A ─┬─ E ── F ── G master
90102
```
91103
{: .-box-chars.-setup}
92104

93-
| `master..fix` | BCD |
94-
| `master...fix` | BCD and EFG |
105+
| _`git log`_ `master..fix` | BCD |
106+
| _`git log`_ `master...fix` | BCD and EFG |
107+
{: .-mute-em}
108+
109+
## References
110+
111+
* [Git Tools - Revision Selection](https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html) _(git-scm.com)_
112+
* [gitrevisions(7)](https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html) _(kernel.org)_

0 commit comments

Comments
 (0)