From 6cf3493058f0903e296c3ae20bd8fb09e186a7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Lamand=C3=A9?= Date: Fri, 5 Feb 2021 23:26:07 +0100 Subject: [PATCH] Add the mention of push --force-with-lease (#1611) `--force-with-lease` is safer than `--force` as it checks that you are up-to-date with the remote branch. --- git-branch.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git-branch.md b/git-branch.md index 65b43a039..0057ba9af 100644 --- a/git-branch.md +++ b/git-branch.md @@ -95,6 +95,9 @@ git reset --hard ```bash git reset --hard $commit_id -# Now push to your branch +# Now push safely to your branch +git push --force-with-lease + +# Or push brutally to your branch git push --force ```