Skip to content
Ryan Leavengood edited this page Aug 23, 2014 · 4 revisions

Forking a Go project like Lime is a bit different than other kinds of projects. Due to the nature of Go packaging, it is important to maintain the same name for the repo in your local $GOPATH when making changes and fixes which you intend to send back with pull requests. This is because the Lime code references the full path to its other packages through-out the code like so:

import (
    . "github.com/limetext/lime/backend"
)

So let's walk through the process.

  • You should follow the directions in the Building document.
  • Fork Lime on GitHub, and copy the URL shown for your fork into your clipboard.
  • Go into $GOPATH/src/github.com/limetext/lime and type the following command:
git remote add fork <your GitHub fork URL, pasted from the clipboard>
  • Make your code changes, compile and test them, then:
git push fork
  • Then you can open a pull request to Lime to get your code merged into the main repository.
  • To keep your fork in sync with the original lime repo, you essentially need to do:
git pull origin
git push fork

For more information about this, read the GitHub documentation about forks. Just keep in mind that for Go projects things work in reverse: instead of cloning your fork and adding the upstream as a remote, you clone the upstream and add your fork as a remote.