From 90d67bb648ae32d5b1a0f7b1af011da6dfb24315 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Mon, 19 Dec 2016 23:36:44 +0100 Subject: remote: add Push (#178) * remote: add Push. * add Push method to Remote. * add method Push to Repository. * examples: add push example. * requested changes * add tests, fixes --- examples/push/main.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/push/main.go (limited to 'examples/push/main.go') 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("") + repoPath := os.Args[1] + + repo, err := git.NewFilesystemRepository(repoPath) + CheckIfError(err) + + err = repo.Push(&git.PushOptions{}) + CheckIfError(err) + + fmt.Print("pushed") +} -- cgit