Skip to content

1800alex/go-git-cmd-wrapper

 
 

Repository files navigation

Go Git Cmd Wrapper

Build Status PkgGoDev Go Report Card

Sponsor

It's a simple wrapper around git command.

Import github.com/1800alex/go-git-cmd-wrapper/v2/git.

// clone
output, err := git.Clone(clone.Repository("https://github.com/1800alex/prm"))
// with debug option
output, err := git.Clone(clone.Repository("https://github.com/1800alex/prm"), git.Debug)
output, err := git.Clone(clone.Repository("https://github.com/1800alex/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/1800alex/prm"))

More examples: Documentation

Packages

No packages published

Languages

  • Go 99.9%
  • Makefile 0.1%