| Máximo Cuadros | 579d1ac | 2016-02-16 12:22:25 | [diff] [blame] | 1 | // Package git is a low level and highly extensible git client library for |
| 2 | // reading repositories from git servers. It is written in Go from scratch, |
| 3 | // without any C dependencies. |
| 4 | // |
| 5 | // We have been following the open/close principle in its design to facilitate |
| 6 | // extensions. |
| Máximo Cuadros | 86fa761 | 2016-02-16 16:21:00 | [diff] [blame] | 7 | // |
| 8 | // Small example extracting the commits from a repository: |
| 9 | // func ExampleBasic_printCommits() { |
| 10 | // r, err := git.NewRepository("https://github.com/src-d/go-git", nil) |
| 11 | // if err != nil { |
| 12 | // panic(err) |
| 13 | // } |
| 14 | // |
| 15 | // if err := r.Pull("origin", "refs/heads/master"); err != nil { |
| 16 | // panic(err) |
| 17 | // } |
| 18 | // |
| 19 | // iter := r.Commits() |
| 20 | // defer iter.Close() |
| 21 | // |
| 22 | // for { |
| 23 | // commit, err := iter.Next() |
| 24 | // if err != nil { |
| 25 | // if err == io.EOF { |
| 26 | // break |
| 27 | // } |
| 28 | // |
| 29 | // panic(err) |
| 30 | // } |
| 31 | // |
| 32 | // fmt.Println(commit) |
| Máximo Cuadros | 1931dfb | 2016-02-16 16:31:09 | [diff] [blame] | 33 | // } |
| Máximo Cuadros | 86fa761 | 2016-02-16 16:21:00 | [diff] [blame] | 34 | // } |
| Máximo Cuadros | 579d1ac | 2016-02-16 12:22:25 | [diff] [blame] | 35 | package git |