class documentation

A Git stash.

Note that this doesn't currently update the working tree.

Class Method from_repo Create a new stash from a Repo object.
Method __getitem__ Get stash entry by index.
Method __init__ Initialize Stash.
Method __len__ Return number of stash entries.
Method drop Drop entry with specified index.
Method pop Pop a stash entry and apply its changes.
Method push Create a new stash.
Method stashes Get list of stash entries.
Instance Variable _ref Undocumented
Instance Variable _repo Undocumented
Property _reflog_path Undocumented
def from_repo(cls, repo: Repo) -> Stash:

Create a new stash from a Repo object.

def __getitem__(self, index: int) -> Entry:

Get stash entry by index.

def __init__(self, repo: Repo, ref: Ref = DEFAULT_STASH_REF):

Initialize Stash.

Parameters
repo:RepoRepository object
ref:RefStash reference name
def __len__(self) -> int:

Return number of stash entries.

def drop(self, index: int):

Drop entry with specified index.

def pop(self, index: int) -> Entry:

Pop a stash entry and apply its changes.

Parameters
index:intIndex of the stash entry to pop (0 is the most recent)
Returns
EntryThe stash entry that was popped
def push(self, committer: bytes | None = None, author: bytes | None = None, message: bytes | None = None) -> ObjectID:

Create a new stash.

Parameters
committer:bytes | NoneOptional committer name to use
author:bytes | NoneOptional author name to use
message:bytes | NoneOptional commit message
Returns
ObjectIDUndocumented
def stashes(self) -> list[Entry]:

Get list of stash entries.

Returns
list[Entry]List of stash entries in chronological order
_ref =

Undocumented

_repo =

Undocumented

_reflog_path: str =

Undocumented