Improve contributing instructions (bug 1041234)
This commit is contained in:
Родитель
f95cb71525
Коммит
4850457432
|
@ -0,0 +1,77 @@
|
|||
.. _contributing:
|
||||
|
||||
============
|
||||
Contributing
|
||||
============
|
||||
|
||||
The easiest way to let us know about your awesome work is to send a pull
|
||||
request on github or in IRC.
|
||||
|
||||
Use **summary (bug #bugzilla bug ID#)** for the commit message. Eg::
|
||||
|
||||
Improve contributing instructions (bug 1041234)
|
||||
|
||||
Point us to a branch with your new code and we'll
|
||||
go from there. You can attach a patch to a bug if you're more comfortable that
|
||||
way.
|
||||
|
||||
Please read the :ref:`style`.
|
||||
|
||||
The Perfect Git Configuration
|
||||
-----------------------------
|
||||
|
||||
We're going to talk about two git repositories:
|
||||
|
||||
* *origin* will be the main olympia repo at http://github.com/mozilla/olympia.
|
||||
* *mine* will be your fork at http://github.com/:user/olympia.
|
||||
|
||||
There should be something like this in your ``.git/config`` already::
|
||||
|
||||
[remote "origin"]
|
||||
url = git://github.com/mozilla/olympia.git
|
||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||
|
||||
Now we'll set up your master to pull directly from the upstream olympia::
|
||||
|
||||
[branch "master"]
|
||||
remote = origin
|
||||
merge = master
|
||||
rebase = true
|
||||
|
||||
This can also be done through the ``git config`` command (e.g.
|
||||
``git config branch.master.remote origin``) but editing ``.git/config`` is
|
||||
often easier.
|
||||
|
||||
After you've forked the repository on github, tell git about your new repo::
|
||||
|
||||
git remote add -f mine git@github.com:user/olympia.git
|
||||
|
||||
Make sure to replace *user* with your name.
|
||||
|
||||
|
||||
Working on a Branch
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Let's work on a bug in a branch called *my-bug*::
|
||||
|
||||
git checkout -b my-bug master
|
||||
|
||||
Now we're switched to a new branch that was copied from master. We like to
|
||||
work on feature branches, but the master is still moving along. How do we keep
|
||||
up? ::
|
||||
|
||||
git fetch origin && git rebase origin/master
|
||||
|
||||
If you want to keep the master branch up to date, do it this way::
|
||||
|
||||
git checkout master && git pull && git checkout @{-1} && git rebase master
|
||||
|
||||
That updated master and then switched back to update our branch.
|
||||
|
||||
|
||||
Publishing your Branch
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
The syntax is ``git push <repository> <branch>``. Here's how to push the
|
||||
``my-bug`` branch to your clone::
|
||||
|
||||
git push mine my-bug
|
|
@ -10,6 +10,8 @@ If you like what we've done, you may want to check out Mozilla's `Playdoh`_.
|
|||
We took all the cool stuff we did in AMO, SUMO and our other websites, and
|
||||
created a base template for new websites.
|
||||
|
||||
Please report bugs or suggest features here: https://bugzilla.mozilla.org/enter_bug.cgi?product=addons.mozilla.org
|
||||
|
||||
.. _`addons.mozilla.org`: https://addons.mozilla.org
|
||||
.. _`install docs`: http://olympia.readthedocs.org/en/latest/topics/install-olympia/index.html
|
||||
.. _`irc://irc.mozilla.org/amo`: irc://irc.mozilla.org/amo
|
||||
|
|
|
@ -1,71 +1 @@
|
|||
.. _contributing:
|
||||
|
||||
============
|
||||
Contributing
|
||||
============
|
||||
|
||||
The easiest way to let us know about your awesome work is to send a pull
|
||||
request on github or in IRC. Point us to a branch with your new code and we'll
|
||||
go from there. You can attach a patch to a bug if you're more comfortable that
|
||||
way.
|
||||
|
||||
Please read the :ref:`style`.
|
||||
|
||||
The Perfect Git Configuration
|
||||
-----------------------------
|
||||
|
||||
We're going to talk about two git repositories:
|
||||
|
||||
* *origin* will be the main olympia repo at http://github.com/mozilla/olympia.
|
||||
* *mine* will be your fork at http://github.com/:user/olympia.
|
||||
|
||||
There should be something like this in your ``.git/config`` already::
|
||||
|
||||
[remote "origin"]
|
||||
url = git://github.com/mozilla/olympia.git
|
||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||
|
||||
Now we'll set up your master to pull directly from the upstream olympia::
|
||||
|
||||
[branch "master"]
|
||||
remote = origin
|
||||
merge = master
|
||||
rebase = true
|
||||
|
||||
This can also be done through the ``git config`` command (e.g.
|
||||
``git config branch.master.remote origin``) but editing ``.git/config`` is
|
||||
often easier.
|
||||
|
||||
After you've forked the repository on github, tell git about your new repo::
|
||||
|
||||
git remote add -f mine git@github.com:user/olympia.git
|
||||
|
||||
Make sure to replace *user* with your name.
|
||||
|
||||
|
||||
Working on a Branch
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Let's work on a bug in a branch called *my-bug*::
|
||||
|
||||
git checkout -b my-bug master
|
||||
|
||||
Now we're switched to a new branch that was copied from master. We like to
|
||||
work on feature branches, but the master is still moving along. How do we keep
|
||||
up? ::
|
||||
|
||||
git fetch origin && git rebase origin/master
|
||||
|
||||
If you want to keep the master branch up to date, do it this way::
|
||||
|
||||
git checkout master && git pull && git checkout @{-1} && git rebase master
|
||||
|
||||
That updated master and then switched back to update our branch.
|
||||
|
||||
|
||||
Publishing your Branch
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
The syntax is ``git push <repository> <branch>``. Here's how to push the
|
||||
``my-bug`` branch to your clone::
|
||||
|
||||
git push mine my-bug
|
||||
.. include:: ../../../CONTRIBUTING.rst
|
||||
|
|
Загрузка…
Ссылка в новой задаче