Saheel Godhane
Saheel Godhane

Reputation: 333

GitPython -- How to 'git stash' changes to a GitPython repository?

I have a repo created via GitPython library that has some uncommitted changes. I want to stash those changes. How do I do it?

Searching for "stash" in the GitPython docs returned no results.

Upvotes: 12

Views: 6099

Answers (1)

unutbu
unutbu

Reputation: 879471

Per the docs, "Using git directly":

In case you are missing functionality as it has not been wrapped, you may conveniently use the git command directly. It is owned by each repository instance.

Thus, you could call git stash save with

repo.git.stash('save')

Upvotes: 16

Related Questions