Skip to content

Pulling Guide: New feature branches

randomskk edited this page Sep 15, 2010 · 5 revisions

SomeUser has made a cool new feature on their fork, someuser/cool-feature, and has filed a pull request (with id pull-id) to get the code into UKHAS mainstream!

Great, but how do you pull?

First Checks

Check out the code in the pull request page! It should look really great. Watch out for coding style, tests being written, comments where appropriate, nothing silly going on, copyright headers at the tops of files and all that nonsense. Check there's a story for this feature in the tracker, too, and that it has been Delivered (it should show Accept or Reject as options).

Make sure you're up to date locally

    $ git checkout develop
    $ git status
    # On branch develop
    nothing to commit (working directory clean)

Don't get the above? Stop and check your develop branch is clean!

    $ git fetch ukhas
    $ git merge --ff-only ukhas/develop

Didn't merge successfully? You have local commits to develop which should have been pushed to UKHAS. Rebase them from the latest UKHAS develop (git rebase ukhas/develop develop) and push them first, then continue here.

Get their code

    # Add them as a remote the first time, after that skip straight to fetch
    $ git remote add someuser http://github.com/someuser/habitat.git
    $ git fetch someuser
    $ git merge --no-ff -m "Pulling SomeUser's cool feature into mainstream. Closes #**pull-id**" someuser/cool-feature

Now you've merged their code locally, it's time to check it out! Run nosetests, make sure the code has copyright headers, etc. You can also inspect the code from the github pull request page, which shows changes in the commits to be pulled. As the person pushing the code to UKHAS, you're also responsible for checking it passes tests.

Beam it up

    # All ready?
    $ git push ukhas develop

Finishing Touches

Finally, you should Accept the story on Pivotal. Just click 'Accept' on the appropriate story.