Skip to content

Commit b8d3ce6

Browse files
committed
Edit conflict resolution section
1 parent 9f471f4 commit b8d3ce6

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/doc/en/developer/git_basic.rst

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ consider the following code snippet:
329329
"""
330330
return fibonacci(i-1) * fibonacci(i-2)
331331
332-
This is clearly wrong; Two developers, namely Alice and Bob, decide to
332+
This is clearly wrong. Two developers, namely Alice and Bob, decide to
333333
fix it. Bob corrected the seed values:
334334

335335
.. CODE-BLOCK:: python
@@ -344,12 +344,15 @@ fix it. Bob corrected the seed values:
344344
345345
and turned those changes into a new commit::
346346

347-
[alice@laptop sage]$ git add fibonacci.py
348-
[alice@laptop sage]$ git commit -m 'return correct seed values'
347+
[bob@laptop sage]$ git add fibonacci.py
348+
[bob@laptop sage]$ git commit -m 'return correct seed values'
349+
350+
He made his changes a PR to the GitHub Sage repo and got it merged to the
351+
``develop`` branch. His ``fibonacci`` function is not yet perfect but is
352+
certainly better than the original.
349353

350-
He made her changes a PR to the GitHub sage repo and quickly got merged to the ``develop`` branch. Yes, his `fibonacci` function is not yet perfect but is certainly better than the original. Meanwhile, Alice changed the
351-
multiplication to an addition since that is the correct recursion
352-
formula:
354+
Meanwhile, Alice changed the multiplication to an addition since that is the
355+
correct recursion formula:
353356

354357
.. CODE-BLOCK:: python
355358
@@ -359,11 +362,12 @@ formula:
359362
"""
360363
return fibonacci(i-1) + fibonacci(i-2)
361364
362-
and merged his branch with the latest ``develop`` branch fetched from the GitHub Sage repo::
365+
and merged her branch with the latest ``develop`` branch fetched from the GitHub Sage repo::
363366

364-
[bob@home sage]$ git add fibonacci.py
365-
[bob@home sage]$ git commit -m 'corrected recursion formula, must be + instead of *'
366-
[bob@home sage]$ git merge develop
367+
[alice@home sage]$ git add fibonacci.py
368+
[alice@home sage]$ git commit -m 'corrected recursion formula, must be + instead of *'
369+
[alice@home sage]$ git fetch upstream develop:develop
370+
[alice@home sage]$ git merge develop
367371
...
368372
CONFLICT (content): Merge conflict in fibonacci.py
369373
Automatic merge failed; fix conflicts and then commit the result.
@@ -379,11 +383,11 @@ The file now looks like this:
379383
Return the `i`-th Fibonacci number
380384
"""
381385
<<<<<<< HEAD
386+
return fibonacci(i-1) + fibonacci(i-2)
387+
=======
382388
if i > 1:
383389
return fibonacci(i-1) * fibonacci(i-2)
384390
return [0, 1][i]
385-
=======
386-
return fibonacci(i-1) + fibonacci(i-2)
387391
>>>>>>> 41675dfaedbfb89dcff0a47e520be4aa2b6c5d1b
388392
389393
The conflict is shown between the conflict markers ``<<<<<<<`` and

0 commit comments

Comments
 (0)