You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2022/10/20 21:43:50 UTC

[arrow] 03/13: ARROW-18069: [Docs] Suggest using force with lease initially (#14430)

This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch maint-10.0.0
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit 01039aa6fa9085abaf68b14dcc758dd198f8e4da
Author: Benson Muite <bk...@users.noreply.github.com>
AuthorDate: Mon Oct 17 18:46:38 2022 +0300

    ARROW-18069: [Docs] Suggest using force with lease initially (#14430)
    
    This ensures commits are not lost unintentionally, see
    https://itnext.io/git-force-vs-force-with-lease-9d0e753e8c41
    
    Lead-authored-by: Benson Muite <bk...@users.noreply.github.com>
    Co-authored-by: Antoine Pitrou <pi...@free.fr>
    Co-authored-by: Sutou Kouhei <ko...@cozmixng.org>
    Signed-off-by: Antoine Pitrou <an...@python.org>
---
 docs/source/developers/overview.rst | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/docs/source/developers/overview.rst b/docs/source/developers/overview.rst
index 3c580afba7..9e4b2bf9e0 100644
--- a/docs/source/developers/overview.rst
+++ b/docs/source/developers/overview.rst
@@ -64,12 +64,18 @@ checklist for using ``git``:
     straightforward.
 
     Once you have an updated local copy, you can push to your remote repo.  Note, since your
-    remote repo still holds the old history, you would need to do a force push.
+    remote repo still holds the old history, you would need to do a force push.  Most pushes
+    should use ``--force-with-lease``:
 
     .. code:: console
 
-       $ git push --force origin branch
+       $ git push --force-with-lease origin branch
 
+    The option ``--force-with-lease`` will fail if the remote has commits that are not available
+    locally, for example if additional commits have been made by a colleague.  By using
+    ``--force-with-lease`` instead of ``--force``, you ensure those commits are not overwritten
+    and can fetch those changes if desired.
+    
   .. dropdown:: Setting rebase to be default
     :animate: fade-in-slide-down
     :class-container: sd-shadow-md