diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-06-30 14:30:30 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-06-30 14:30:31 -0700 |
| commit | 91f10d7ca2c41922a7c8b07aec90167896c5db51 (patch) | |
| tree | f8b947d7e04cb87548913baac8ba757ff0a20737 /Documentation | |
| parent | a013680162522425ab74d12f1d0cd4df1a389383 (diff) | |
| parent | bc303718cc288b54233b204ce88223a16fb38487 (diff) | |
| download | git-91f10d7ca2c41922a7c8b07aec90167896c5db51.tar.xz | |
Merge branch 'bc/stash-export-import'
An interchange format for stash entries is defined, and subcommand
of "git stash" to import/export has been added.
* bc/stash-export-import:
builtin/stash: provide a way to import stashes from a ref
builtin/stash: provide a way to export stashes to a ref
builtin/stash: factor out revision parsing into a function
object-name: make get_oid quietly return an error
Diffstat (limited to 'Documentation')
| -rw-r--r-- | Documentation/git-stash.adoc | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Documentation/git-stash.adoc b/Documentation/git-stash.adoc index 1a5177f498..e5e6c9d37f 100644 --- a/Documentation/git-stash.adoc +++ b/Documentation/git-stash.adoc @@ -23,6 +23,8 @@ SYNOPSIS 'git stash' clear 'git stash' create [<message>] 'git stash' store [(-m | --message) <message>] [-q | --quiet] <commit> +'git stash' export (--print | --to-ref <ref>) [<stash>...] +'git stash' import <commit> DESCRIPTION ----------- @@ -154,6 +156,18 @@ store:: reflog. This is intended to be useful for scripts. It is probably not the command you want to use; see "push" above. +export ( --print | --to-ref <ref> ) [<stash>...]:: + + Export the specified stashes, or all of them if none are specified, to + a chain of commits which can be transferred using the normal fetch and + push mechanisms, then imported using the `import` subcommand. + +import <commit>:: + + Import the specified stashes from the specified commit, which must have been + created by `export`, and add them to the list of stashes. To replace the + existing stashes, use `clear` first. + OPTIONS ------- -a:: @@ -242,6 +256,19 @@ literally (including newlines and quotes). + Quiet, suppress feedback messages. +--print:: + This option is only valid for the `export` command. ++ +Create the chain of commits representing the exported stashes without +storing it anywhere in the ref namespace and print the object ID to +standard output. This is designed for scripts. + +--to-ref:: + This option is only valid for the `export` command. ++ +Create the chain of commits representing the exported stashes and store +it to the specified ref. + \--:: This option is only valid for `push` command. + @@ -259,7 +286,7 @@ For more details, see the 'pathspec' entry in linkgit:gitglossary[7]. <stash>:: This option is only valid for `apply`, `branch`, `drop`, `pop`, - `show` commands. + `show`, and `export` commands. + A reference of the form `stash@{<revision>}`. When no `<stash>` is given, the latest stash is assumed (that is, `stash@{0}`). |
