Merge

Guite edited this page Nov 12, 2014 · 2 revisions
Clone this wiki locally

Pull Requests

Collaborators will receive pull requests by email and they can also be viewed in the "Pull Requests" section at each Github project.

Merge Process

There are several ways to merge work from a contributor. The easiest is by using the 'fork queue' at Github. This however can produce unpleasant merge commits.

The easier way is to fetch, merge and push.

Let's take an example of contributor 'bob', whose forked the core to his own project page at git://github.com/bob/core.git

Initial Setup

You only need to do this once if you have never received a patch from this contributor. Add their remote:

git remote add bob git://github.com/bob/core.git

Fetch branch

Now you can fetch the branch from Bob's repository;

git fetch bob

Merge branch (simple)

Bob asked us to merge in branch ticket_1234

git checkout master
git merge bob/ticket_1234

If you need to verify the branch properly

Verify branch

git checkout -B bob/ticket_1234

You can then check the code works correctly. When you are satisfied you can merge the branch in with:

git checkout master
git merge bob/ticket_1234

If you want to rebase the branch to make the merge history linear use:

git checkout bob/ticket_1234
git rebase master
git checkout master
git merge -ff bob/ticket_1234

Example merging to a release branch, then then into "master".

git fetch planetenkiller
git checkout release-1.3
git merge planetenkiller/doctrine2-extensions-impl
git checkout master
git merge planetenkiller/doctrine2-extensions-impl
git push