diff options
Diffstat (limited to 'examples/push/main.go')
-rw-r--r-- | examples/push/main.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/push/main.go b/examples/push/main.go new file mode 100644 index 0000000..9a30599 --- /dev/null +++ b/examples/push/main.go @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "os" + + "gopkg.in/src-d/go-git.v4" + . "gopkg.in/src-d/go-git.v4/examples" +) + +func main() { + CheckArgs("<repo path>") + repoPath := os.Args[1] + + repo, err := git.NewFilesystemRepository(repoPath) + CheckIfError(err) + + err = repo.Push(&git.PushOptions{}) + CheckIfError(err) + + fmt.Print("pushed") +} |