aboutsummaryrefslogtreecommitdiffstats
path: root/examples/push/main.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-12-19 23:36:44 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-12-19 23:36:44 +0100
commit90d67bb648ae32d5b1a0f7b1af011da6dfb24315 (patch)
treefc8c14e82974be6ff49e842328ec3206ebf1b4c2 /examples/push/main.go
parent725ade0de6f60549e65cc4d94094b1f5ed48587f (diff)
downloadgo-git-90d67bb648ae32d5b1a0f7b1af011da6dfb24315.tar.gz
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
Diffstat (limited to 'examples/push/main.go')
-rw-r--r--examples/push/main.go22
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")
+}