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 ::
391
391
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
392
392
393
393
What 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
397
396
changes and then try pushing again. In some cases, such as if you and a
398
397
colleague are both committing and pushing to the same branch, this is the
399
398
correct 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).
402
400
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 ::
406
403
407
404
$ git push --force-with-lease
408
405
You can’t perform that action at this time.
0 commit comments