Skip to end of metadata
Go to start of metadata

Initial Setup

First, make sure you know the email address associated with your JIRA credentials. All commits pushed to the master repository are checked against these addresses, so your repository will need to be configured to use that address. The following will give you that information:

  • Visit the ZF Crowd install: http://framework.zend.com/crowd
  • Log in, if you aren't.
  • Find the "My Profile" link in the upper right of the page, and follow it.
  • The resulting page will display your profile, including the email address with which you are registered. Make a note of it.
Windows Users
If you use Windows, and are unfamiliar with using Git or using Git on Windows, we recommend reading the illustrated guide to git on windows.

Setup your own public repository

Your next step is to establish a public repository from which we can pull your work into the master repository. You have two options: use github or other public site, or setup/use your own repository.

Option 1: GitHub

  • Setup a GitHub account, if you haven't yet
  • Fork the ZF2 repository
  • Setup an ssh key for github to use (if you haven't yet), using this explanation: http://help.github.com/linux-key-setup/
  • Clone your fork locally and enter it (use your own GitHub username in the statement below)
  • Configure git to use the email address with which you are registered in JIRA:
  • Add a remote to the canonical ZF repository (or GitHub mirror), so you can keep your fork up-to-date:

Option 2: Personal Repository

We assume you will use gitosis or gitolite to host your own repository. If you go this route, we will assume you have the knowledge to do so, or know where to obtain it. We will not assist you in setting up such a repository.

  • Create a new repository
  • Configure git to use the email address with which you are registered in JIRA:
  • Add an "origin" remote pointing to your gitosis/gitolite repo:
  • Add a remote for the ZF repository and fetch it
  • Create a new branch for the ZF repository (named "zf/master" here)
  • Create your master branch off the ZF branch, and push to your repository

Keeping Up-to-Date

Periodically, you should update your fork or personal repository to match the canonical ZF repository. In each of the above setups, we have added a remote to the Zend Framework repository, which allows you to do the following:

Working on Zend Framework

When working on Zend Framework, we recommend you do each new feature or bugfix in a new branch. This simplifies the task of code review as well as of merging your changes into the canonical repository.

A typical work flow will then consist of the following:

  • Create a new local branch based off your master branch.
  • Switch to your new local branch. (This step can be combined with the previous step with the use of `git checkout -b`.)
  • Do some work, commit, repeat as necessary.
  • Push the local branch to your remote repository.
  • Send a pull request.

We recommend naming your branches as follows:

  • "hotfix/<issue ID>" for bugfixes; e.g. "hotfix/ZF-9295"
  • "feature/<feature name>" for features; e.g., "feature/translate-resource-es"

The mechanics of this process are actually quite trivial. Below, we will create a branch for fixing an issue in the tracker.

To send a pull request, you have two options.

If using GitHub, you can do the pull request from there. Navigate to your repository, select the branch you just created, and then select the "Pull Request" button in the upper right. Select the user "zendframework" as the recipient.

If using your own repository - or even if using GitHub - you can send an email indicating you have changes to pull:

  • Send to zf-devteam@zend.com
  • In your message, specify:
    • The URL to your repository (e.g., "git://mwop.net/zf2.git")
    • The branch containing the changes you want pulled (e.g., "hotfix/ZF-9295")
    • The nature of the changes (e.g., "implements Zend_Service_Twitter", "fixes ZF-9295", etc.)

In order to generate the pull request message automatically git-request-pull may be used.

For example, to ask to pull changes from milestones/exceptions/slideshare branch on your github fork git@github.com:USERNAME/zf2.git into zf2/milestones/exceptions:

The above will generate message you can send to zf-devteam@zend.com, it has all necessary bits of information injected.

Branch Cleanup

As you might imagine, if you are a frequent contributor, you'll start to get a ton of branches both locally and on your remote.

Once you know that your changes have been accepted to the master repository, we suggest doing some cleanup of these branches.

  • Local branch cleanup
  • Remote branch removal

Feeds and Emails

RSS feeds may be found at:

where <branch> is a branch in the repository.

To subscribe to git email notifications, send an email to:

You will need to reply to the verification email sent to you by this list.

Should you wish to filter emails from the list, they will use the "subject" line of commit messages, preceded by "[branch] ", and come from "zf-git@lists.zend.com".

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jun 18, 2010

    I recommend to name the ZF2 repository remote 'upstream' instead of 'zf2'. This is so you can keep it consistent if you are also contributing to other projects using git.

    Another recommendation is for the github users, to use git://git.zendframework.com/zf.git as the remote. This since the zf2 mirror on github isn't updated as fast as updates come in on the official repository.

    Oh, and for the github pull requests, who should we send the pull request to ?

    1. Jun 18, 2010

      github pull requests go to zf-devteam already.

      1. Jun 18, 2010

        Well, if you make a github pull request the way you suggest, you get this screen:

        http://images.firal.org/caps/9516c0.png

        What my question is: what username should I select? I guess this is the 'zendframework' github user, but it might be a good idea to be a little more clear about this .

        1. Jun 18, 2010

          Ah – yes – that's exactly the user. I'll update the doc.

    2. Jun 18, 2010

      I understand your reasoning for naming it "upstream". However, on my own repository, I'm attaching to both git and svn – which makes "upstream" nebulous. I went for a more explicit name in the case of these examples for this reason.

  2. Jul 10, 2010

    @Matthew and @Pieter kokx: sometime i am happy with your text. sometimes i became angry with your descriptions. For ZF 2.0 i am completely angry, many migrations will need, many changes is made, dont know documentation will again be sucked!, its a f... nightmare framework (FNF).

    its very good, you rule ZF. But its very evil and bad, you dont wirte transparent (you dont care head and tail), for rest of the world? The words are not belongs to you and only to your team, its in public, world is reading your word's, they have individual teams/teams leaders.

    Please be specific for ZF 2.0!:
    1. Qt how to git?
    2. JDeveloper how to git?
    2. Netbeans how to git?
    3. Eclipse how to git?

    Try to make things kiss ("keep it simple stupid's").

    Thanks in advance

    1. Jul 11, 2010

      Well shams, change is needed. If you don't innovate, you will be stuck in the past. And I will assure you, if we wouldn't change ZF so 'drastically' with version 2.0, we will be hailed by all other frameworks around in under two years.

      This is just a very simple guide, and I agree with you that it isn't finished. Also, this is a space clearly for ZF contributors, not for 'the world'. And most ZF contributors already know a bit about git, and they know how to use google.

      Writing guides for every way to use git in IDE's, simply isn't feasible at all. I know that both me and Matthew don't use IDE's (we're both vim users), so we cannot exactly describe how this all should work in <name-your-IDE>. And another thing is that if its hard with an IDE to translate git commands to how the IDE works with git, I'm quite sure that the IDE's git support is very poor.

      Also note that besides ZF, most of us have a life too.

      Oh, and you can edit the page too you know .

    2. Mar 04, 2011

      shams: I missed this comment come through, evidently, so my apologies for the late reply.

      I really don't understand your anger at all. I don't understand what you mean by "you dont wirte transparent (you dont care head and tail), for rest of the world" – this wiki is public, and anybody who has an account can edit it and add pages to it.

      I can't tell you how to use Git on Qt, JDeveloper, Netbeans or Eclipse. However, if you can, or another contributor can, you're free to write up a page detailing the process. It makes more sense for developers who use those tools to write these pages, to ensure that the correct information is provided.

      Finally, yes, we're aware people will need a migration path. We will be providing an SVN mirror of the Git repo, likely around the time we go beta, so that developers using svn can continue to use svn:externals. Additionally, we'll be writing guides for how to utilize ZF2 as either a git submodule or via git subtree merging. For now, however, those efforts don't make sense as the repository is highly volatile.

  3. Aug 03, 2010

    If using GitHub, you can do the pull request from there. Navigate to your repository, select the branch you just created, and then select the "Pull Request" button in the upper right. Select the user "zendframework" as the recipient.

    When doing a pull request there is no such user as 'zendframework'. I can though open http://github.com/zendframework which is an organization. Is this a github bug and one should just type 'zendframework' manually?

  4. Dec 09, 2010

    Hello there,

    I thought I should add this step which is needed before you clone the fork locally (option 1).

    http://help.github.com/linux-key-setup/
    (this is for linux... I'm not that adventurous to be using windows for development!)

    You might want to edit this guide to include this step in order to save some poor souls from frustration...

    Cheers,
    Angel

    1. Mar 05, 2012

      Thanks a million, I am one of the poor souls you saved! And I edited the guide, to give this great tip a more prominent place.