Skip to content

Instantly share code, notes, and snippets.

@Xiol
Xiol / git2go-checkout-branch.go
Created March 1, 2017 08:37 — 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{