Skip to content

Example for git reset HEAD -- filename.type please #601

Open
@barry-scott

Description

@barry-scott

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions