From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 21FB31F8C6 for ; Tue, 29 Jun 2021 15:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234850AbhF2PbW (ORCPT ); Tue, 29 Jun 2021 11:31:22 -0400 Received: from smtprelay02.ispgateway.de ([80.67.18.14]:42376 "EHLO smtprelay02.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234852AbhF2PbR (ORCPT ); Tue, 29 Jun 2021 11:31:17 -0400 Received: from [79.233.236.111] (helo=[192.168.2.202]) by smtprelay02.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1lyFf3-0001sj-Vm for git@vger.kernel.org; Tue, 29 Jun 2021 17:28:30 +0200 From: Martin To: git@vger.kernel.org Subject: PATCH: improve git switch documentation Message-ID: Date: Tue, 29 Jun 2021 17:28:48 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Df-Sender: bWVAbWZyaWViZS5kZQ== Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Below is a patch, that I believe would improve the documentation of git switch. The exact new wording is of course open for debate. Reasoning for the change. The current doc does not explain why the option is a "forceful" option. Nor does explain the consequences. Instead it leaves it to the user to lookup the alternate command, and find the meaning of     git branch -f newbranch Only if the user does that successfully, the user may learn about the full consequences of their actions. I believe this info should be part of the "git switch" doc, itself. (Especially due to the severity that the action may have). From 46580d07f95a18c94925afd141ba55e52a82c8e1 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 29 Jun 2021 17:22:25 +0200 Subject: [PATCH] Update git-switch.txt --- Documentation/git-switch.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/git-switch.txt b/Documentation/git-switch.txt index 5c438cd5058758..80acafad1f4a46 100644 --- a/Documentation/git-switch.txt +++ b/Documentation/git-switch.txt @@ -70,8 +70,12 @@ $ git switch -C :: --force-create :: Similar to `--create` except that if `` already - exists, it will be reset to ``. This is a - convenient shortcut for: + exists, it will be reset to ``. + This forces the branch to the new location. It also forces + any commit hold by the branch to be dropped, unless the + commit is also part of any other branch too. You may + therefore loose some of your data. + This is a convenient shortcut for: + ------------ $ git branch -f