Recommend safer "git push --force-with-lease" (#732)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Patrick Decat 2020-11-22 21:32:08 +01:00 committed by GitHub
parent e292a207ff
commit 8b991cede0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,14 @@ After rebasing your branch, you will have rewritten history relative to your Git
```shell
# Run this from your feature branch
git push origin --force-with-lease
```
If that command fails, it means that new work was pushed to the branch from either you or another contributor since your last rebase.
You will have to start over the git fetch and rebase process described above, or if you are really confident those changes are not needed, just overwrite them:
```shell
# Run this from your feature branch, overwriting any changes in the remote branch
git push origin --force
```