Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf53019

Browse files
tacaswelljklymak
andcommitted
DOC: add diagram with missing commits
Co-authored-by: Jody Klymak <[email protected]>
1 parent 82932e8 commit cf53019

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

doc/devel/development_workflow.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,17 @@ fail with an error that looks like ::
403403
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
404404

405405
If this push had succeed then the commits ``A``, ``B``, and ``C`` would no
406-
longer be referenced by any branch and be discarded. By default ``git push``
407-
helpfully tries to protect you from accidentally discarding commits by
408-
rejecting the push to the remote. When this happens, GitHub also adds the
409-
helpful suggestion to pull the remote changes and then try pushing again. In
410-
some cases, such as if you and a colleague are both committing and pushing to
411-
the same branch, this is a correct course of action.
406+
longer be referenced by any branch and be discarded:
407+
408+
.. code-block:: none
409+
410+
D---A'---E cool-feature, origin/cool-feature
411+
412+
By default ``git push`` helpfully tries to protect you from accidentally
413+
discarding commits by rejecting the push to the remote. When this happens,
414+
GitHub also adds the helpful suggestion to pull the remote changes and then try
415+
pushing again. In some cases, such as if you and a colleague are both
416+
committing and pushing to the same branch, this is a correct course of action.
412417

413418
However, in the case of having intentionally re-written history we *want* to
414419
discard the commits on the remote and replace them with the new-and-improved

0 commit comments

Comments
 (0)