diff options
Diffstat (limited to 'doc.go')
-rw-r--r-- | doc.go | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -4,4 +4,31 @@ // // We have been following the open/close principle in its design to facilitate // extensions. +// +// Small example extracting the commits from a repository: +// func ExampleBasic_printCommits() { +// r, err := git.NewRepository("https://github.com/src-d/go-git", nil) +// if err != nil { +// panic(err) +// } +// +// if err := r.Pull("origin", "refs/heads/master"); err != nil { +// panic(err) +// } +// +// iter := r.Commits() +// defer iter.Close() +// +// for { +// commit, err := iter.Next() +// if err != nil { +// if err == io.EOF { +// break +// } +// +// panic(err) +// } +// +// fmt.Println(commit) +// } package git |