func (s *GitService) GetRef(ctx context.Context, 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
	}
	req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
	r := new(Reference)
	resp, err := s.client.Do(ctx, req, r)
	if _, ok := err.(*json.UnmarshalTypeError); ok {
		return nil, resp, errors.New("no exact match found for this ref")
	} else if err != nil {
		return nil, resp, err
	}
	return r, resp, nil
}
GetRef fetches a single Reference object for a given Git ref.
If there is no exact match, GetRef will return an error.

Note: The GitHub API can return multiple matches.
If you wish to use this functionality please use the GetRefs() method.

GitHub API docs: https://developer.github.com/v3/git/refs/#get-a-reference
package github
import (
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"strings"
)
type Reference struct {
	Ref    *string    `json:"ref"`
	URL    *string    `json:"url"`
	Object *GitObject `json:"object"`
	NodeID *string    `json:"node_id,omitempty"`
}
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"`
}