@@ -163,8 +163,8 @@ C/C++ extensions
163
163
docstrings, and the Numpydoc format is well understood in the
164
164
scientific Python community.
165
165
166
- Rebasing a Pull Request
167
- -----------------------
166
+ Rebasing a Pull Request (PR)
167
+ ----------------------------
168
168
169
169
When working on a PR, changes may occur in the parent branch (usually master).
170
170
This can lead to conflict with changes in your branch. The conflicts can be
@@ -187,38 +187,29 @@ bad practice, but in this case it is very useful.
187
187
188
188
The following example assumes that the remote of _your_ github
189
189
repository is called `github ` and the remote of the official
190
- repository is called `upstream `.
190
+ repository is called `matplotlib `.
191
191
192
192
The first step is to make sure that your local copy of the upstream repository is
193
193
up-to-date::
194
194
195
- $ git fetch upstream
195
+ $ git fetch matplotlib
196
196
197
197
This updates your local copy of the repository, but does not change any files
198
198
in your working copy. Next, switch to the branch that you want to update::
199
199
200
200
$ git checkout backend_plt_refactor
201
201
202
202
You are now ready to start the rebase of your branch onto the target
203
- parent branch, in this case `upstream /master ` ::
203
+ parent branch, in this case `matplotlib /master ` ::
204
204
205
- $ git rebase upstream /master
205
+ $ git rebase matplotlib /master
206
206
207
207
and git will then give a bunch of feed back::
208
208
209
209
First, rewinding head to replay your work on top of it...
210
210
Applying: first steps to extract FigureManager* and friends from pyplot
211
211
Applying: split backend_qt4 into two parts, with and without Gcf
212
- Applying: split backend_qt4agg into two parts.
213
- Applying: Added a demo-file to show how to use the FigureManager classes to
214
- Applying: removed un-needed import of Gcf
215
- Applying: pep8 on backend_gtk.py
216
- Applying: pep8 clean up in backend_gdk
217
- Applying: removed un-needed Gcf import
218
- Applying: split backend_gcf into two parts,
219
- Applying: pep8 on backend_gtkagg.py
220
- Applying: split backend_gktagg.py in to two parts
221
- Applying: updated exclude list
212
+ ...
222
213
Applying: pep8 clean up on backend_gtk3.py
223
214
Using index info to reconstruct a base tree...
224
215
M lib/matplotlib/backends/backend_gtk3.py
@@ -235,7 +226,7 @@ and git will then give a bunch of feed back::
235
226
To check out the original branch and stop rebasing, run "git rebase --abort".
236
227
237
228
A number of commits could be cleanly applied to
238
- the tip of `upstream /master `, however, git eventually hit a commit
229
+ the tip of `matplotlib /master `, however, git eventually hits a commit
239
230
that had conflicts. In this case in the file
240
231
`lib/matplotlib/backends/backend_gtk3.py `. For more verbose information run ::
241
232
@@ -254,8 +245,9 @@ that had conflicts. In this case in the file
254
245
255
246
no changes added to commit (use "git add" and/or "git commit -a")
256
247
257
- This exactly where the conflict is and some advice on how to proceed. Opening
258
- up the file in question, you will see blocks that look something like this::
248
+ This tells you exactly where the conflict is and provides some advice
249
+ on how to proceed. Opening up the file in question, you will see
250
+ blocks that look something like this::
259
251
260
252
<<<<<<< HEAD
261
253
=======
@@ -272,7 +264,7 @@ resolved all the conflicts, `add` the file to the index::
272
264
$ git add lib/matplotlib/backends/backend_gtk3.py
273
265
274
266
Repeat this for all of the files that have conflicts. When you are done with
275
- that we can check the status::
267
+ that you can check the status::
276
268
277
269
$ git status
278
270
rebase in progress; onto e6f8993
@@ -290,20 +282,22 @@ commit and can continue::
290
282
$ git rebase --continue
291
283
292
284
You now iterate the until you have made it through all of the commits
293
- which have conflicts.
285
+ which have conflicts. Once you have successfully rebased your branch,
286
+ be sure to re-run the tests to make sure everything is still working
287
+ properly.
294
288
295
- Your branch is now rebased, however, because of the way git determines
296
- the hash of each commit, it now shares no commits with your old branch
297
- published on github so you can not push to that branch as you would when
298
- simply adding commits. In order to publish your newly re-based branch you need to
299
- use the `--force ` flag::
289
+ Your branch is now rebased, however, because of the way git
290
+ determines the hash of each commit, it now shares no commits with your
291
+ old branch published on github so you can not push to that branch as
292
+ you would when simply adding commits. In order to publish your newly
293
+ rebased (and tested!) branch you need to use the `--force ` flag::
300
294
301
295
$ git push --force github
302
296
303
297
which will _replace_ all of the commits under your branch on github
304
298
with the new versions of the commit.
305
299
306
- Congratulations, you have re-based your branch!
300
+ Congratulations, you have rebased your branch!
307
301
308
302
309
303
Style guide
0 commit comments