https://github.com/fsamin/go-repo
Go-Repo is just golang wrapper around git commands
https://github.com/fsamin/go-repo
Last synced: about 2 months ago
JSON representation
Go-Repo is just golang wrapper around git commands
- Host: GitHub
- URL: https://github.com/fsamin/go-repo
- Owner: fsamin
- License: apache-2.0
- Created: 2018-01-23T09:59:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T09:56:06.000Z (7 months ago)
- Last Synced: 2024-10-29T11:52:53.840Z (7 months ago)
- Language: Go
- Homepage:
- Size: 191 KB
- Stars: 5
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# go-repo
Go-Repo is just wrapper arround git commands.
[](http://godoc.org/github.com/fsamin/go-repo) [](https://travis-ci.org/fsamin/go-repo) [](https://goreportcard.com/report/github.com/fsamin/go-repo)
## Clone a repository
````golang
r, err := Clone(path, "https://github.com/fsamin/go-repo.git")
...
````## Get current branch
````golang
r, err := Clone(path, "https://github.com/fsamin/go-repo.git")
...
b, err := r.CurrentBranch()
...
fmt.Println(b)
````## Fetch & Pull a remote branch
````golang
r, err := Clone(path, "https://github.com/fsamin/go-repo.git")
...
err = r.FetchRemoteBranch("origin", "tests")
...
err = r.Pull("origin", "tests")
...
````## Git local config
````golang
r, err := Clone(path, "https://github.com/fsamin/go-repo.git")
...
r.LocalConfigSet("foo", "bar", "value"))
val, err := r.LocalConfigGet("foo", "bar")
...
````## Search and open files
````golang
r, err := Clone(path, "https://github.com/fsamin/go-repo.git")
...
files, err := r.Glob("**/*.md")
...
f, err := r.Open(files[0])
...
````