Skip to content

Commit a6edce0

Browse files
authored
docs(libra): add documentation for the stash (#1365)
1 parent 9c05fe3 commit a6edce0

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: The [stash] Command
3+
description: Stash the changes in a dirty working directory away
4+
---
5+
6+
### Usage
7+
8+
libra stash `<subcommand>` \[OPTIONS\] \[STASH\]
9+
10+
### Description
11+
12+
Use `libra stash` when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the `HEAD` commit.
13+
14+
The modifications stashed away by this command can be listed with `libra stash list`, inspected with `libra stash show`, and restored (potentially on top of a different commit) with `libra stash apply`. Calling `libra stash` without any arguments is equivalent to `libra stash push`.
15+
16+
### Subcommands
17+
18+
- **`push [-m | --message <message>]`**
19+
Save your local modifications to a new stash entry and roll back to the `HEAD` commit. The `<message>` part is optional and gives the description along with the stashed state.
20+
21+
- **`pop [stash]`**
22+
Remove a single stashed state from the stash list and apply it on top of the current working tree state. If no `stash` is given, it defaults to the latest one (`stash@{0}`).
23+
24+
- **`list`**
25+
List the stash entries that you currently have. Each stash entry is listed with its name (e.g. `stash@{0}`) and the description from when it was created.
26+
27+
- **`apply [stash]`**
28+
Like `pop`, but do not remove the stashed state from the stash list. If no `stash` is given, it defaults to the latest one (`stash@{0}`).
29+
30+
- **`drop [stash]`**
31+
Remove a single stashed state from the stash list. If no `stash` is given, it defaults to the latest one (`stash@{0}`).
32+
33+
### Arguments
34+
35+
- `[STASH]`
36+
A reference to a specific stash. The syntax is `stash@{<revision>}` (e.g., `stash@{0}` for the latest stash, `stash@{1}` for the one before, etc.). If not specified, the command defaults to the latest stash.

‎aria/lib/routes-config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const ROUTES: EachRoute[] = [
5858
{ title: "reset", href: "/reset" },
5959
{ title: "restore", href: "/restore" },
6060
{ title: "rm", href: "/rm" },
61+
{ title: "stash", href: "/stash" },
6162
{ title: "status", href: "/status" },
6263
{ title: "switch", href: "/switch" },
6364
{ title: "tag", href: "/tag" },

0 commit comments

Comments
 (0)