git

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: Unlicense Imports: 13 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. It store a temporary file in your .git directory or /tmp if accessed outside of a git repo.

func GitDir

func GitDir() (string, error)

GitDir returns the full path to the .git directory

func InsideGitRepo added in v0.9.1

func InsideGitRepo() bool

InsideGitRepo returns true when the current working directory is inside the working tree of a git repo

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 Respects GitLab subgroups (https://docs.gitlab.com/ce/user/group/subgroups/)

func RemoteAdd

func RemoteAdd(name, url, dir 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