ldez / go-git-cmd-wrapper

A simple wrapper around git command in Go.

Home Page:https://pkg.go.dev/github.com/ldez/go-git-cmd-wrapper/v2/git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A simple wrapper around git command in Go.

https://pkg.go.dev/github.com/ldez/go-git-cmd-wrapper/v2/git

License:Apache License 2.0


Languages

Language:Go 99.9%Language:Makefile 0.1%