如何做一个混帐重置 - 使用gitPython? [英] How to do a git reset --hard using gitPython?
问题描述
git reset --hard
(在终端上)的python代码?我在 reset rel =nofollow noreferrer>文档,并找到这个:
class git.refs.head .HEAD(repo,path ='HEAD')
reset(commit ='HEAD',index = True ,working_tree = False,paths = None,** kwargs)
将HEAD重置为给定的提交,可以同步索引和工作树。我们引用的参考将被设置为提交。
Well the title is self explanatory. What will be the python code equivalent to running git reset --hard
(on terminal) using GitPython module?
I searched for reset
in the documentation and found this:
class git.refs.head.HEAD(repo, path='HEAD')
reset(commit='HEAD', index=True, working_tree=False, paths=None, **kwargs)
Reset our HEAD to the given commit optionally synchronizing the index and working tree. The reference we refer to will be set to commit as well.
这篇关于如何做一个混帐重置 - 使用gitPython?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!