You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorial.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ git-cl: A Git subcommand to manage changelists in Git. Group files by intent, ma
25
25
-[2.5 Commit a changelist](#25-commit-a-changelist)
26
26
-[2.6 Remove files from changelists](#26-remove-files-from-changelists)
27
27
-[2.7 Delete changelists](#27-delete-changelists)
28
+
-[2.8 Stash and Unstash Changelists](#28-stash-and-unstash-changelists)
28
29
-[3. Example Workflow: Changelists as Named Staging Areas](#3-example-workflow-changelists-as-named-staging-areas)
29
30
-[4. FAQ & Common Pitfalls](#4-faq--common-pitfalls)
30
31
-[5. Command Summary](#5-command-summary)
@@ -326,6 +327,55 @@ git cl delete --all
326
327
327
328
Only changelist metadata is deleted — no file content or Git history is lost.
328
329
330
+
### 2.8 Stash and Unstash Changelists
331
+
332
+
You can temporarily shelve changelists using `stash`, then restore them later with `unstash`. This is useful when switching branches or pausing work on a feature.
333
+
334
+
#### Stash a changelist
335
+
336
+
```
337
+
git cl stash <changelist-name>
338
+
```
339
+
340
+
- Saves unstaged and untracked changes from the changelist.
341
+
- Staged changes are skipped.
342
+
- The stash is named after the changelist and timestamped.
343
+
344
+
#### Unstash a changelist
345
+
346
+
```
347
+
git cl unstash <changelist-name>
348
+
```
349
+
350
+
- Restores the previously stashed changes.
351
+
- Warns if files conflict with current working directory.
352
+
353
+
#### Stash all changelists
354
+
355
+
```
356
+
git cl stash --all
357
+
```
358
+
359
+
- Stashes all active changelists.
360
+
- Useful before switching branches or pulling updates.
361
+
362
+
#### Unstash all changelists
363
+
364
+
```
365
+
git cl unstash --all
366
+
```
367
+
- Restores all previously stashed changelists.
368
+
369
+
#### Example
370
+
371
+
```
372
+
git cl stash docs
373
+
git checkout feature-branch
374
+
git cl unstash docs
375
+
```
376
+
377
+
This lets you move work-in-progress between branches without committing or losing context.
378
+
329
379
[↑ Back to top](#git-cl-a-git-subcommand-for-changelist-management)
330
380
331
381
## 3. Example Workflow: Changelists as Named Staging Areas
0 commit comments