Skip to content

Instantly share code, notes, and snippets.

@allomov
Created January 19, 2018 13:45
Embed
What would you like to do?
var {Checkout, Submodule, Repository} = require("nodegit");
Repository.open("/native-repo")
.then(function(repository) {
return repository.getTagByName("v1.0.8")
.then(function(result) { console.dir(result); return result; })
.then(function(tag) { console.dir([tag.targetId(), repository.defaultSignature, "Checkout: HEAD " + tag.targetId()]); return tag; })
.then(function(tag) { repository.setHeadDetached(tag.targetId(), repository.defaultSignature, "Checkout: HEAD " + tag.targetId()) })
})
.then(function() { console.log("done");})
.done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment