Skip to content

Instantly share code, notes, and snippets.

@davidewatson
davidewatson / git2go-checkout-branch.go
Created December 4, 2016 00:09 — forked from danielfbm/git2go-checkout-branch.go
How to do a git checkout branch using git2go
package main
import (
"errors"
"log"
"github.com/libgit2/git2go"
)
func checkoutBranch(repo *git.Repository, branchName string) error {
checkoutOpts := &git.CheckoutOpts{