I'm trying to know how I can get the branch in which a commit was created in (not the head). I know a branch is just a 'tag' attached to a commit (the head of that branch)

For example, in this image, what would I need to do to get the branch of the node E using nodegit or another git library.
I looked in the documentation, but I didn't find an equivalent to git branch --contains
Thanks !
You'd have to:
NodeGit.Merge.base(repository, branchTip, interestedCommit).returnedCommit === interestedCommit then you're fineIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With