GitPython -- 如何 'git stash' 更改 GitPython 存储库?

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

我有一个通过 GitPython 库创建的存储库,其中有一些未提交的更改。我想隐藏这些更改。我该怎么做?

在 GitPython docs 中搜索 "stash" 未返回任何结果。

根据文档,"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.

因此,您可以用

调用git stash save
repo.git.stash('save')