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