Skip to content

Commit ac3541e

Browse files
committed
Update Git cheatsheet
1 parent d68e985 commit ac3541e

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

src/content/notes/cheatsheet-git.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
---
22
title: "Cheatsheet: Git"
33
dateCreated: 2024-11-12
4-
dateUpdated: 2025-08-25
4+
dateUpdated: 2025-12-08
55
---
66

7-
This cheatsheet assumes that you're already familiar with Git concepts and know
8-
the usual `init`, `pull`, `add`, `commit`, `push` flow. It aims to document
9-
commands and flags that I tend to use but forget when I haven't used them in a
10-
while.
7+
## Preamble
8+
9+
### Aims
10+
11+
To document Git commands and flags that I tend to use but forget when I haven't
12+
used them in a while.
13+
14+
### Assumptions
15+
16+
Familiarity with Git concepts and the usual `init`, `pull`, `add`, `commit`,
17+
`push` flow.
1118

1219
## Branching
1320

@@ -85,6 +92,12 @@ git branch -D <branch>
8592
git stash
8693
```
8794

95+
Or to stash only a specific file or directory:
96+
97+
```console
98+
git stash -- <path>
99+
```
100+
88101
Or to add a message to remember the stash by:
89102

90103
```console
@@ -277,3 +290,14 @@ git push [<repository>] <local-branch>:<remote-branch>
277290
- <https://stackoverflow.com/q/927358>
278291
- <https://stackoverflow.com/q/1085162>
279292
- <https://stackoverflow.com/q/1186535>
293+
294+
## Changelog
295+
296+
- December 08, 2025
297+
- Update "Stash changes" by adding the command to stash only a specific file
298+
or directory
299+
- Break down introductory paragraph into sections
300+
- August 25, 2025
301+
- Add "Show changes in stash"
302+
- Add "Fix rebase conflicts"
303+
- Add "Push to a remote branch with a different name"

0 commit comments

Comments
 (0)