Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 1.32 KB

readme.md

File metadata and controls

28 lines (20 loc) · 1.32 KB

Go Git Cmd Wrapper

Build Status PkgGoDev Go Report Card

Sponsor

It's a simple wrapper around git command.

Import github.com/ldez/go-git-cmd-wrapper/v2/git.

// clone
output, err := git.Clone(clone.Repository("https://github.com/ldez/prm"))
// with debug option
output, err := git.Clone(clone.Repository("https://github.com/ldez/prm"), git.Debug)
output, err := git.Clone(clone.Repository("https://github.com/ldez/prm"), git.Debugger(true))

// fetch
output, err = git.Fetch(fetch.NoTags, fetch.Remote("upstream"))
output, err = git.Fetch(fetch.NoTags, fetch.Remote("upstream"), fetch.RefSpec("master"))

// add a remote
output, err = git.Remote(remote.Add, remote.Name("upstream"), remote.URL("https://github.com/ldez/prm"))

More examples: Documentation