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: 3 months 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 (about 8 years ago)
- Default Branch: main
- Last Pushed: 2025-03-25T03:00:52.000Z (3 months ago)
- Last Synced: 2025-03-28T12:04:10.376Z (3 months 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: 230 KB
- Stars: 55
- Watchers: 6
- Forks: 17
- 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
[](https://github.com/ldez/go-git-cmd-wrapper/actions)
[](https://pkg.go.dev/github.com/ldez/go-git-cmd-wrapper/v2)
[](https://goreportcard.com/report/github.com/ldez/go-git-cmd-wrapper)[](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)