layout
default
menu_item
api
title
Stash
description
Version 0.19.0
return_to
API Documentation Index
/api/
sections
apply
applyInitOptions
drop
foreach
pop
save
APPLY_FLAGS
APPLY_PROGRESS
FLAGS
#apply
#applyInitOptions
#drop
#foreach
#pop
#save
#APPLY_FLAGS
#APPLY_PROGRESS
#FLAGS
Stash . apply ( repo , index , options ) . then ( function ( result ) {
// Use result
} ) ;
Parameters
Type
repo
Repository
The owning repository.
index
Number
The position within the stash list. 0 points to the most recent stashed state.
options
StashApplyOptions
Options to control how stashes are applied.
Returns
Number
0 on success, GIT_ENOTFOUND if there's no stashed state for the
given index, GIT_EMERGECONFLICT if changes exist in the working
directory, or an error code |
Stash. applyInitOptions Sync
var result = Stash . applyInitOptions ( opts , version ) ;
Parameters
Type
opts
StashApplyOptions
the git_stash_apply_options instance to initialize.
version
Number
the version of the struct; you should pass GIT_STASH_APPLY_OPTIONS_INIT here.
Returns
Number
Zero on success; -1 on failure.
Stash . drop ( repo , index ) . then ( function ( result ) {
// Use result
} ) ;
Parameters
Type
repo
Repository
The owning repository.
index
Number
The position within the stash list. 0 points to the most recent stashed state.
Returns
Number
0 on success, GIT_ENOTFOUND if there's no stashed state for the given
index, or error code.
Stash . foreach ( repo , callback , payload ) . then ( function ( result ) {
// Use result
} ) ;
Parameters
Type
repo
Repository
Repository where to find the stash.
callback
StashCb
Callback to invoke per found stashed state. The most recent stash state will be enumerated first.
payload
Void
Extra parameter to callback function.
Returns
Number
0 on success, non-zero callback return value, or error code.
Stash . pop ( repo , index , options ) . then ( function ( result ) {
// Use result
} ) ;
Parameters
Type
repo
Repository
The owning repository.
index
Number
The position within the stash list. 0 points to the most recent stashed state.
options
StashApplyOptions
Options to control how stashes are applied.
Returns
Number
0 on success, GIT_ENOTFOUND if there's no stashed state for the given
index, or error code. (see git_stash_apply() above for details)
Stash . save ( repo , stasher , message , flags ) . then ( function ( oid ) {
// Use oid
} ) ;
| Flag | Value |
| --- | --- | --- |
| Stash.APPLY_FLAGS. APPLY_DEFAULT | 0 |
| Stash.APPLY_FLAGS. APPLY_REINSTATE_INDEX | 1 |
Stash. APPLY_PROGRESS ENUM
| Flag | Value |
| --- | --- | --- |
| Stash.APPLY_PROGRESS. NONE | 0 |
| Stash.APPLY_PROGRESS. LOADING_STASH | 1 |
| Stash.APPLY_PROGRESS. ANALYZE_INDEX | 2 |
| Stash.APPLY_PROGRESS. ANALYZE_MODIFIED | 3 |
| Stash.APPLY_PROGRESS. ANALYZE_UNTRACKED | 4 |
| Stash.APPLY_PROGRESS. CHECKOUT_UNTRACKED | 5 |
| Stash.APPLY_PROGRESS. CHECKOUT_MODIFIED | 6 |
| Stash.APPLY_PROGRESS. DONE | 7 |
| Flag | Value |
| --- | --- | --- |
| Stash.FLAGS. DEFAULT | 0 |
| Stash.FLAGS. KEEP_INDEX | 1 |
| Stash.FLAGS. INCLUDE_UNTRACKED | 2 |
| Stash.FLAGS. INCLUDE_IGNORED | 4 |