Skip to content

Instantly share code, notes, and snippets.

@allomov
Created January 19, 2018 13:45
Show Gist options
  • Save allomov/5e79a213d189c3c6d1775828aca5d8f1 to your computer and use it in GitHub Desktop.
Save allomov/5e79a213d189c3c6d1775828aca5d8f1 to your computer and use it in GitHub Desktop.
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