Skip to content

Commit b256726

Browse files
[Contributing] Added workflow details on bugfix patches for latest active branch
The contributing guide doesn't really explain how to set up one's workspace for working on bugfixes for the 2.0 branch - some of the examples for working with the master branch refer to using "2.0" instead when working on a bugfix, but this doesn't work if some additional preparations have not been done by the contributor before.
1 parent cb29085 commit b256726

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

contributing/code/patches.rst

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,26 @@ Create the topic branch with the following command:
155155
156156
$ git checkout -b BRANCH_NAME master
157157
158-
.. tip::
158+
Or, if you want to provide a bugfix for the 2.0 branch, you need to first track
159+
the remote `2.0` branch locally:
160+
161+
.. code-block:: bash
162+
163+
$ git checkout -t origin/2.0
164+
165+
Then you can create a new branch off the 2.0 branch to work on the bugfix:
159166

160-
Replace "master" by, for example, 2.0, if you wish to submit a patch to the
161-
2.0 branch.
167+
.. code-block:: bash
168+
169+
$ git checkout -b BRANCH_NAME 2.0
162170
163171
.. tip::
164172

165173
Use a descriptive name for your branch (`ticket_XXX` where `XXX` is the
166174
ticket number is a good convention for bug fixes).
167175

168-
The above command automatically switches the code to the newly created branch
169-
(check the branch you are working on with `git branch`).
176+
The above checkout commands automatically switch the code to the newly created
177+
branch (check the branch you are working on with `git branch`).
170178

171179
Work on the code as much as you want and commit as much as you want; but keep
172180
in mind the following:
@@ -205,6 +213,10 @@ while to finish your changes):
205213
$ git checkout BRANCH_NAME
206214
$ git rebase master
207215
216+
.. tip::
217+
218+
Replace `master` with `2.0` if you are working on a bugfix
219+
208220
When doing the ``rebase`` command, you might have to fix merge conflicts.
209221
``git status`` will show you the *unmerged* files. Resolve all the conflicts,
210222
then continue the rebase:
@@ -236,7 +248,8 @@ BRANCH_NAME``) or the pull request URL.
236248

237249
Based on the feedback from the mailing-list or via the pull request on GitHub,
238250
you might need to rework your patch. Before re-submitting the patch, rebase
239-
with master, don't merge; and force the push to the origin:
251+
with upstream/master or upstream/2.0, don't merge; and force the push to the
252+
origin:
240253

241254
.. code-block:: bash
242255
@@ -288,4 +301,4 @@ the `2.0` branch, the patch will also be applied by the core team on the
288301
.. _dev mailing-list: http://groups.google.com/group/symfony-devs
289302
.. _travis-ci.org: http://travis-ci.org
290303
.. _`travis-ci.org status icon`: http://about.travis-ci.org/docs/user/status-images/
291-
.. _`travis-ci.org Getting Started Guide`: http://about.travis-ci.org/docs/user/getting-started/
304+
.. _`travis-ci.org Getting Started Guide`: http://about.travis-ci.org/docs/user/getting-started/

0 commit comments

Comments
 (0)