Skip to content

Commit 270986b

Browse files
authored
Update tutorial.md
1 parent c49a22d commit 270986b

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

docs/tutorial.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ git-cl: A Git subcommand to manage changelists in Git. Group files by intent, ma
2121
- [Git Status codes](#git-status-codes)
2222
- [Color Key](#color-key)
2323
- [2.3 Diff a changelist](#23-diff-a-changelist)
24-
- [2.4 Stage a changelist](#24-stage-a-changelist)
24+
- [2.4 Stage and unstage a changelist](#24-stage-and-unstage-a-changelist)
2525
- [2.5 Commit a changelist](#25-commit-a-changelist)
2626
- [2.6 Remove files from changelists](#26-remove-files-from-changelists)
2727
- [2.7 Delete changelists](#27-delete-changelists)
@@ -229,15 +229,17 @@ git cl diff docs tests # Show combined diff for both 'docs' and 'tests'
229229
git cl diff docs --staged # Show staged changes for 'docs' changelist
230230
```
231231

232-
### 2.4 Stage a changelist
232+
### 2.4 Stage and Unstage a Changelist
233+
234+
#### Stage a changelist
233235

234236
```
235237
git cl stage <changelist-name>
236238
```
237239

238-
- Stages all tracked files from the changelist.
239-
- Only files already tracked by Git will be staged. Untracked files ([??]) in the changelist are safely ignored and remain untracked unless you add them with `git add` first.
240-
- Changelist is deleted after staging.
240+
- Stages all tracked files in the changelist.
241+
- Untracked files ([??]) are ignored unless added with git add.
242+
- The changelist is deleted after staging, unless --keep is used.
241243

242244
#### Example
243245

@@ -248,6 +250,24 @@ git commit -m "Refactor docs"
248250

249251
Tip: Run `git cl diff` first if you want to review the changes before staging.
250252

253+
#### Unstage a changelist
254+
255+
```
256+
git cl unstage <changelist-name>
257+
```
258+
259+
- Unstages files from the changelist (i.e. removes them from the index).
260+
- Only applies to staged files — unchanged or unstaged files are ignored.
261+
- Files remain in the changelist and your working directory.
262+
263+
#### Example
264+
265+
```
266+
git cl unstage docs
267+
```
268+
269+
This is useful when you've staged something too early and want to pull it back without losing the changelist group.
270+
251271
### 2.5 Commit a changelist
252272

253273
```

0 commit comments

Comments
 (0)