This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Description
I think it would be great to add as many examples to the repo as possible, given that workflows are different. i.e.:
git cli: git checkout ae200dcc6592716c757372cf01825f21a6b6xxxx
go-git, sudo, : repo.Worktree().Checkout(plumbing.NewHash("ae200dcc6592716c757372cf01825f21a6b6xxxx")
Although this might be trivial to git-pros, I think it's really good to include common scenarios like this one. I'd love to submit a quick pr for it. Here's a simple example:
repo, err := git.PlainClone("/tmp/foo", false, &git.CloneOptions{
URL: "https://github.com/src-d/go-git.git",
Progress: os.Stdout,
})
CheckIfError(err)
wt, err := repo.Worktree()
CheckIfError(err)
commitRef := plumbing.NewHash("ae200dcc6592716c757372cf01825f21a6b6xxxx")
err = wt.Checkout(commitRef)
CheckIfError(err)