pygit2 icon indicating copy to clipboard operation
pygit2 copied to clipboard

Example for git reset HEAD -- filename.type please

Open barry-scott opened this issue 9 years ago • 0 comments

I am coming at GIT with an external view of how it works. Internals I have very little idea about.

I have figured out that I need to call repo.reset() to do the same as git reset HEAD -- filename.type.

But I have no idea how to find the OID that I need to use.

Looking at git-reset code I seem to need a treeish. How do I get a treeish that corresponds to HEAD? I guess I walk that tree looking for the filename and get a OID from the tree.

barry-scott avatar Feb 29 '16 18:02 barry-scott