@@ -93,6 +93,29 @@ Set up your user information with your real name and a working email address:
93
93
If you are new to Git, we highly recommend you to read the excellent and
94
94
free `ProGit `_ book.
95
95
96
+ .. tip ::
97
+
98
+ Windows users: when installing Git, the installer will ask what to do with
99
+ line endings and suggests to replace all Lf by CRLF. This is the wrong
100
+ setting if you wish to contribute to Symfony! Selecting the as-is method is
101
+ your best choice, as git will convert your line feeds to the ones in the
102
+ repository. If you have already installed Git, you can check the value of
103
+ this setting by typing:
104
+
105
+ .. code-block :: bash
106
+
107
+ $ git config core.autocrlf
108
+
109
+ This will return either "false", "input" or "true", "true" and "false" being
110
+ the wrong values. Set it to another value by typing:
111
+
112
+ .. code-block :: bash
113
+
114
+ $ git config --global core.autocrlf input
115
+
116
+ Replace --global by --local if you want to set it only for the active
117
+ repository
118
+
96
119
Get the Symfony2 source code:
97
120
98
121
* Create a `GitHub `_ account and sign in;
@@ -132,6 +155,11 @@ Create the topic branch with the following command:
132
155
133
156
$ git checkout -b BRANCH_NAME master
134
157
158
+ .. tip ::
159
+
160
+ Replace "master" by, for example, 2.0, if you wish to submit a patch to the
161
+ 2.0 branch.
162
+
135
163
.. tip ::
136
164
137
165
Use a descriptive name for your branch (`ticket_XXX ` where `XXX ` is the
@@ -215,6 +243,35 @@ with master, don't merge; and force the push to the origin:
215
243
$ git rebase -f upstream/master
216
244
$ git push -f origin BRANCH_NAME
217
245
246
+ .. note ::
247
+
248
+ when doing a push -f (or --force), always specify the branch name explicitly
249
+ to avoid messing other branches in the repo (--force tells git that you
250
+ really want to mess with things so do it carefully).
251
+
252
+ Often, moderators will ask you to "squash" your commits. This means you will
253
+ convert many commits to one commit. To do this, use the rebase command:
254
+
255
+ .. code-block :: bash
256
+
257
+ $ git rebase -i head~3
258
+ $ git push -f origin BRANCH_NAME
259
+
260
+ The number 3 here must equal the amount of commits in your branch. After you
261
+ type this command, an editor will popup showing a list of commits:
262
+
263
+ .. code-block :: text
264
+
265
+ pick 1a31be6 first commit
266
+ pick 7fc64b4 second commit
267
+ pick 7d33018 third commit
268
+
269
+ To squash all commits into the first one, remove the word "pick" before the
270
+ second and the last commits, and replace it by the word "squash" or just "s".
271
+ When you save, git will start rebasing, and if succesful, will ask you to edit
272
+ the commit message, which by default is a listing of the commit messages of all
273
+ the commits. When you finish, execute the push command.
274
+
218
275
.. note ::
219
276
220
277
All patches you are going to submit must be released under the MIT
0 commit comments