func (s *GitService) ListRefs(owner, repo string, opt *ReferenceListOptions) ([]Reference, *Response, error) {
	var u string
	if opt != nil && opt.Type != "" {
		u = fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, opt.Type)
	} else {
		u = fmt.Sprintf("repos/%v/%v/git/refs", owner, repo)
	}
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}
	var rs []Reference
	resp, err := s.client.Do(req, &rs)
	if err != nil {
		return nil, resp, err
	}
	return rs, resp, err
}
ListRefs lists all refs in a repository.

GitHub API docs: http://developer.github.com/v3/git/refs/#get-all-references
package github
import (
	"fmt"
	"strings"
)
type Reference struct {
	Ref    *string    `json:"ref"`
	URL    *string    `json:"url"`
	Object *GitObject `json:"object"`
}
func (r Reference) String() string {
	return Stringify(r)
}
type GitObject struct {
	Type *string `json:"type"`
	SHA  *string `json:"sha"`
	URL  *string `json:"url"`
}
func (o GitObject) String() string {
	return Stringify(o)
}
type createRefRequest struct {
	Ref *string `json:"ref"`
	SHA *string `json:"sha"`
}
type updateRefRequest struct {
	SHA   *string `json:"sha"`
	Force *bool   `json:"force"`
}
func (s *GitService) GetRef(owner string, repo string, ref string) (*Reference, *Response, error) {
	ref = strings.TrimPrefix(ref, "refs/")
	u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, ref)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}
	r := new(Reference)
	resp, err := s.client.Do(req, r)
	if err != nil {
		return nil, resp, err
	}
	return r, resp, err
}
type ReferenceListOptions struct {
	Type string `url:"-"`
	ListOptions
}