File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -391,18 +391,15 @@ push the new commits to GitHub it will fail with an error that looks like ::
391391 hint: See the 'Note about fast-forwards' in 'git push --help' for details.
392392
393393What is going on is that by default ``git push `` tries to protect you from
394- accidentally make commits inaccessible by leaving no reference to them so if a
395- push *would * effectively discard commits on the remote, ``git `` rejects the
396- push. When this happens GitHub adds the helpful suggestion to pull the remote
394+ accidentally discarding commits on the remote by rejecting the
395+ push. When this happens, GitHub adds the helpful suggestion to pull the remote
397396changes and then try pushing again. In some cases, such as if you and a
398397colleague are both committing and pushing to the same branch, this is the
399398correct course of action (or rebase your local branch but it is a matter of
400- taste). Although both of things are good ideas, taken together they are not
401- what we want to do.
399+ taste).
402400
403- In the case of having intentionally re-written history we *want * to make the
404- commits on GitHub inaccessible and replace them with the new-and-improved versions
405- on our local machines. In these cases what we want to do is ::
401+ However, in the case of having intentionally re-written history we *want * to discard the commits and
402+ replace them with the new-and-improved versions from our local branch. In these cases what we want to do is ::
406403
407404 $ git push --force-with-lease
408405
You can’t perform that action at this time.
0 commit comments