git

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2017 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsHub bool

IsHub is true when using "hub" as the git binary

Functions

func CommentChar

func CommentChar() string

CommentChar returns active comment char and defaults to '#'

func CurrentBranch

func CurrentBranch() (string, error)

CurrentBranch returns the currently checked out branch and strips away all but the branchname itself.

func Edit

func Edit(filePrefix, message string) (string, string, error)

Edit opens a file in the users editor and returns the title and body

func GitDir

func GitDir() (string, error)

GitDir returns the full path to the .git directory

func IsRemote added in v0.6.0

func IsRemote(remote string) (bool, error)

IsRemote returns true when passed a valid remote in the git repo

func LastCommitMessage

func LastCommitMessage() (string, error)

LastCommitMessage returns the last commits message as one line

func Log

func Log(sha1, sha2 string) (string, error)

Log produces a a formatted gitlog between 2 git shas

func New

func New(args ...string) *exec.Cmd

New looks up the hub or git binary and returns a cmd which outputs to stdout

func PathWithNameSpace

func PathWithNameSpace(remote string) (string, error)

PathWithNameSpace returns the owner/repository for the current repo Such as zaquestion/lab

func RemoteAdd

func RemoteAdd(name, url string) error

RemoteAdd both adds a remote and fetches it

func RepoName

func RepoName() (string, error)

RepoName returns the name of the repository, such as "lab"

func WorkingDir

func WorkingDir() (string, error)

WorkingDir returns the full pall to the root of the current git repository

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL