github.com/1800alex/go-git-cmd-wrapper@v1.1.0/readme.adoc (about)

     1  = Go Git Cmd Wrapper
     2  
     3  image:https://travis-ci.org/ldez/go-git-cmd-wrapper.svg?branch=master["Build Status", link="https://travis-ci.org/ldez/go-git-cmd-wrapper"]
     4  image:https://godoc.org/github.com/ldez/go-git-cmd-wrapper?status.svg["GoDoc", link="https://godoc.org/github.com/ldez/go-git-cmd-wrapper"]
     5  image:https://goreportcard.com/badge/github.com/ldez/go-git-cmd-wrapper["Go Report Card", link="https://goreportcard.com/report/github.com/ldez/go-git-cmd-wrapper"]
     6  
     7  It's a simple wrapper around `git` command.
     8  
     9  Import `github.com/ldez/go-git-cmd-wrapper`.
    10  
    11  [source, golang]
    12  ----
    13  // clone
    14  output, err := git.Clone(clone.Repository("https://github.com/ldez/gcg"))
    15  // with debug option
    16  output, err := git.Clone(clone.Repository("https://github.com/ldez/gcg"), git.Debug)
    17  output, err := git.Clone(clone.Repository("https://github.com/ldez/gcg"), git.Debugger(true))
    18  
    19  // fetch
    20  output, err = git.Fetch(fetch.NoTags, fetch.Remote("upstream"))
    21  output, err = git.Fetch(fetch.NoTags, fetch.Remote("upstream"), fetch.RefSpec("master"))
    22  
    23  // add a remote
    24  output, err = git.Remote(remote.Add, remote.Name("upstream"), remote.URL("https://github.com/ldez/gcg"))
    25  ----
    26  
    27  More examples: link:https://godoc.org/github.com/ldez/go-git-cmd-wrapper/git[documentation]