From 8b991cede03d2a2979222fde47d956e575399f5e Mon Sep 17 00:00:00 2001 From: Patrick Decat Date: Sun, 22 Nov 2020 21:32:08 +0100 Subject: [PATCH] Recommend safer "git push --force-with-lease" (#732) Co-authored-by: Franck Nijhof --- docs/development_catching_up.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/development_catching_up.md b/docs/development_catching_up.md index fc7d6ed2..0200753d 100644 --- a/docs/development_catching_up.md +++ b/docs/development_catching_up.md @@ -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 ```