Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ldez/go-git-cmd-wrapper
A simple wrapper around git command in Go.
https://github.com/ldez/go-git-cmd-wrapper
command-line git go golang golang-package wrapper
Last synced: 13 days ago
JSON representation
A simple wrapper around git command in Go.
- Host: GitHub
- URL: https://github.com/ldez/go-git-cmd-wrapper
- Owner: ldez
- License: apache-2.0
- Created: 2017-06-04T17:29:21.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-10-01T15:04:33.000Z (about 1 month ago)
- Last Synced: 2024-10-10T12:23:38.557Z (about 1 month ago)
- Topics: command-line, git, go, golang, golang-package, wrapper
- Language: Go
- Homepage: https://pkg.go.dev/github.com/ldez/go-git-cmd-wrapper/v2/git
- Size: 188 KB
- Stars: 56
- Watchers: 7
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Go Git Cmd Wrapper
[![Build Status](https://github.com/ldez/go-git-cmd-wrapper/workflows/Main/badge.svg?branch=main)](https://github.com/ldez/go-git-cmd-wrapper/actions)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/ldez/go-git-cmd-wrapper)](https://pkg.go.dev/github.com/ldez/go-git-cmd-wrapper/v2)
[![Go Report Card](https://goreportcard.com/badge/github.com/ldez/go-git-cmd-wrapper)](https://goreportcard.com/report/github.com/ldez/go-git-cmd-wrapper)[![Sponsor](https://img.shields.io/badge/Sponsor%20me-%E2%9D%A4%EF%B8%8F-pink.svg)](https://github.com/sponsors/ldez)
It's a simple wrapper around `git` command.
Import `github.com/ldez/go-git-cmd-wrapper/v2/git`.
```go
// 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](https://pkg.go.dev/github.com/ldez/go-git-cmd-wrapper/v2/git)