Forking workflow

So you would like to participate in the development of something on https://github.com/dedis. Here is the workflow to use so that we can pull your changes.

Prerequisites

We suppose that:

Getting forked repository

With the example of the cothority-repository, here is what you have to do:

First, you have to fork the dedis/cothority into your own repository, this is most easy by using the fork-button on the page of https://github.com/dedis/cothority.

Next you can fetch both the original and your fork:

go get github.com/dedis/cothority
cd $GOPATH/src/github.com/dedis/cothority
git remote add myfork https://github.com/USER/gogit
git checkout -b NEW_FEATURE

You'll have to replace USER by your username on github and NEW_FEATURE for a comprehensive short explanation on what you are trying to accomplish. We have to do that remote add because of golang using only absolute paths, so you won't be able to use a forked golang-package in your own directory!

Push your changes

Now work on that new, exciting feature (or bug-fix), and when you're done:

git commit -am "implementation of new feature"
git push -u myfork NEW_FEATURE

Again, replace NEW_FEATURE by the name of the branch you gave. The
-u myfork NEW_FEATURE 
is necessary to tell git to open a new branch on the remote side, too. Further git push-commands can omit that part. So if you continue to work, it is enough to do:

git commit -am "added good documentation"
git push

Pull request

Now you're ready to generate a pull-request. The most easy way is to use github.com, browse to your forked directory, chose pull-request on the left side and let the base-fork as-is, but chose your NEW_FEATURE-branch on the head-fork.

Discuss

Once the pull-request is generated, everybody can chime in and give comments on your code. It might be good, some things might have to change, or the approach changed. As you discuss, commit and push your changes, so that they are always visible on the discussion. Once the maintainers from DeDiS decide your code is good, they will merge the pull request.

Of course you always have the possibility to define your fork to be the one and only and attract other developers to work with your fork instead of ours.

List branches

To see what branches are active and where they are pushed to, you can use

git branch -vv