File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,29 @@ with master, don't merge; and force the push to the origin:
242
242
$ git rebase -f upstream/master
243
243
$ git push -f origin BRANCH_NAME
244
244
245
+ Often, moderators will ask you to "squash" your commits. This means you will
246
+ convert many commits to one commit. To do this, use the rebase command:
247
+
248
+ .. code-block :: bash
249
+
250
+ $ git rebase -i head~3
251
+ $ git push -f origin BRANCH_NAME
252
+
253
+ The number 3 here must equal the amount of commits in your branch. After you
254
+ type this command, an editor will popup showing a list of commits:
255
+
256
+ .. code-block :: text
257
+
258
+ pick 1a31be6 first commit
259
+ pick 7fc64b4 second commit
260
+ pick 7d33018 third commit
261
+
262
+ To squash all commits into the first one, remove the word "pick" before the
263
+ second and the last commits, and replace it by the word "squash" or just "s".
264
+ When you save, git will start rebasing, and if succesful, will ask you to edit
265
+ the commit message, which by default is a listing of the commit messages of all
266
+ the commits. When you finish, execute the push command.
267
+
245
268
.. note ::
246
269
247
270
All patches you are going to submit must be released under the MIT
You can’t perform that action at this time.
0 commit comments