···5566It can be used to manipulate git repositories at low level *(plumbing)* or high level *(porcelain)*, through an idiomatic Go API. It also supports several types of storage, such as in-memory filesystems, or custom implementations thanks to the [`Storer`](https://godoc.org/gopkg.in/src-d/go-git.v4/plumbing/storer) interface.
7788-It's being actively develop since 2015 and is being use extensively by [source{d}](https://sourced.tech/) and [Keybase](https://keybase.io/blog/encrypted-git-for-everyone), and by many other libraries and tools.
88+It's being actively developed since 2015 and is being used extensively by [source{d}](https://sourced.tech/) and [Keybase](https://keybase.io/blog/encrypted-git-for-everyone), and by many other libraries and tools.
991010Comparison with git
1111-------------------
12121313*go-git* aims to be fully compatible with [git](https://github.com/git/git), all the *porcelain* operations are implemented to work exactly as *git* does.
14141515-*git* is a humongous project with years of development by thousands of contributors, making it challenging for *go-git* implement all the features. You can find a comparison of *go-git* vs *git* in the [compatibility documentation](COMPATIBILITY.md).
1515+*git* is a humongous project with years of development by thousands of contributors, making it challenging for *go-git* to implement all the features. You can find a comparison of *go-git* vs *git* in the [compatibility documentation](COMPATIBILITY.md).
161617171818Installation
···2424go get -u gopkg.in/src-d/go-git.v4/...
2525```
26262727-> We use [gopkg.in](http://labix.org/gopkg.in) for having a versioned API, this means that when `go get` clones the package, is the latest tag matching `v4.*` cloned and not the master branch.
2727+> We use [gopkg.in](http://labix.org/gopkg.in) to version the API, this means that when `go get` clones the package, it's the latest tag matching `v4.*` that is cloned and not the master branch.
28282929Examples
3030--------
31313232-> Please note that the functions `CheckIfError` and `Info` used in the examples are from the [examples package](https://github.com/src-d/go-git/blob/master/_examples/common.go#L17) just to be used in the examples.
3232+> Please note that the `CheckIfError` and `Info` functions used in the examples are from the [examples package](https://github.com/src-d/go-git/blob/master/_examples/common.go#L17) just to be used in the examples.
333334343535### Basic example
···71717272CheckIfError(err)
73737474-// Gets the HEAD history from HEAD, just like does:
7474+// Gets the HEAD history from HEAD, just like this command:
7575Info("git log")
76767777// ... retrieves the branch pointed by HEAD
···110110...
111111```
112112113113-You can find this [example](_examples/log/main.go) and many others at the [examples](_examples) folder
113113+You can find this [example](_examples/log/main.go) and many others in the [examples](_examples) folder.
114114115115Contribute
116116----------
+2-2
_examples/checkout/main.go
···3838 })
3939 CheckIfError(err)
40404141- // ... retrieving the commit being pointed by HEAD, it's shows that the
4242- // repository is poiting to the giving commit in detached mode
4141+ // ... retrieving the commit being pointed by HEAD, it shows that the
4242+ // repository is pointing to the giving commit in detached mode
4343 Info("git show-ref --head HEAD")
4444 ref, err = r.Head()
4545 CheckIfError(err)
+3-3
_examples/commit/main.go
···1212 "gopkg.in/src-d/go-git.v4/plumbing/object"
1313)
14141515-// Basic example of how to commit changes to the current branch to an existent
1515+// Basic example of how to commit changes to the current branch to an existing
1616// repository.
1717func main() {
1818 CheckArgs("<directory>")
1919 directory := os.Args[1]
20202121- // Opens an already existent repository.
2121+ // Opens an already existing repository.
2222 r, err := git.PlainOpen(directory)
2323 CheckIfError(err)
2424···44444545 fmt.Println(status)
46464747- // Commits the current staging are to the repository, with the new file
4747+ // Commits the current staging area to the repository, with the new file
4848 // just created. We should provide the object.Signature of Author of the
4949 // commit.
5050 Info("git commit -m \"example go-git commit\"")
+1-1
_examples/log/main.go
···2323 })
2424 CheckIfError(err)
25252626- // Gets the HEAD history from HEAD, just like does:
2626+ // Gets the HEAD history from HEAD, just like this command:
2727 Info("git log")
28282929 // ... retrieves the branch pointed by HEAD
+1-1
_examples/open/main.go
···1414 CheckArgs("<path>")
1515 path := os.Args[1]
16161717- // We instance a new repository targeting the given path (the .git folder)
1717+ // We instanciate a new repository targeting the given path (the .git folder)
1818 r, err := git.PlainOpen(path)
1919 CheckIfError(err)
2020
+1-1
_examples/pull/main.go
···1313 CheckArgs("<path>")
1414 path := os.Args[1]
15151616- // We instance a new repository targeting the given path (the .git folder)
1616+ // We instance\iate a new repository targeting the given path (the .git folder)
1717 r, err := git.PlainOpen(path)
1818 CheckIfError(err)
1919
+1-1
_examples/showcase/main.go
···1616// - Get the HEAD reference
1717// - Using the HEAD reference, obtain the commit this reference is pointing to
1818// - Print the commit content
1919-// - Using the commit, iterate all its files and print them
1919+// - Using the commit, iterate over all its files and print them
2020// - Print all the commit history with commit messages, short hash and the
2121// first line of the commit message
2222func main() {
+1-1
_examples/storage/README.md
···667788### and what this means ...
99-*git* has as very well defined storage system, the `.git` directory, present on any repository. This is the place where `git` stores al the [`objects`](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects), [`references`](https://git-scm.com/book/es/v2/Git-Internals-Git-References) and [`configuration`](https://git-scm.com/docs/git-config#_configuration_file). This information is stored in plain files.
99+*git* has a very well defined storage system, the `.git` directory, present on any repository. This is the place where `git` stores all the [`objects`](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects), [`references`](https://git-scm.com/book/es/v2/Git-Internals-Git-References) and [`configuration`](https://git-scm.com/docs/git-config#_configuration_file). This information is stored in plain files.
10101111Our original **go-git** version was designed to work in memory, some time after we added support to read the `.git`, and now we have added support for fully customized [storages](https://godoc.org/gopkg.in/src-d/go-git.v4/storage#Storer).
1212
+1-1
_examples/tag/main.go
···1515 CheckArgs("<path>")
1616 path := os.Args[1]
17171818- // We instance a new repository targeting the given path (the .git folder)
1818+ // We instanciate a new repository targeting the given path (the .git folder)
1919 r, err := git.PlainOpen(path)
2020 CheckIfError(err)
2121