blob: 809c26b084fd6adb825a33a5cd0c62984c10ab8c (
plain) (
tree)
|
|
package main
import (
"os"
"srcd.works/go-git.v4"
. "srcd.works/go-git.v4/_examples"
)
// Example of how to open a repository in a specific path, and push to
// its default remote (origin).
func main() {
CheckArgs("<repository-path>")
path := os.Args[1]
r, err := git.PlainOpen(path)
CheckIfError(err)
Info("git push")
// push using default options
err = r.Push(&git.PushOptions{})
CheckIfError(err)
}
|