From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erick Mattos Subject: [PATCH v4] git checkout -b: unparent the new branch with -o Date: Wed, 17 Mar 2010 15:46:24 -0300 Message-ID: <1268851584-10988-1-git-send-email-erick.mattos@gmail.com> Cc: git@vger.kernel.org, Erick Mattos To: Junio C Hamano X-From: git-owner@vger.kernel.org Wed Mar 17 19:47:46 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NryHR-00029P-Ej for gcvg-git-2@lo.gmane.org; Wed, 17 Mar 2010 19:47:45 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755504Ab0CQSrk (ORCPT ); Wed, 17 Mar 2010 14:47:40 -0400 Received: from mail-qy0-f179.google.com ([209.85.221.179]:63262 "EHLO mail-qy0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755496Ab0CQSri (ORCPT ); Wed, 17 Mar 2010 14:47:38 -0400 Received: by qyk9 with SMTP id 9so644636qyk.1 for ; Wed, 17 Mar 2010 11:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=oFtJl3wXJHgwx+3uCyJnmUJVd35hd1XK1HkyR37FNuQ=; b=cbKF8YDAeH+MPYpaZ28mYh/UIkp+XGgE8807Lfe/XMsC6zEiUF/lTVsPAN2VKFWcKQ TPtRCIJ6FM0hfIiE4oHT4IG/QFPdhi4YJlEfycbDyo0b1hR/Fa0YqroRuVxuHKhdWnMA Hh3IZUE0dNq6oeBAr0Xx1ZUpTN6bxx0PI39UM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=i6cmZxdaCbuAy1p2ZaR2eFzXLJ+woCtx6h8rGMtBh8oZB/cDKnNh3fS38HMdQVy4+B qzmABJQAUT4pDLvV4T1y2GX7J8dNCzUVmapdJ1+31Ilf3MP9iidvoSNWOks+hKV0r3HQ MYMcttGOeI2Zx16ytYo08JkNctY5ScbRSAoDc= Received: by 10.229.131.39 with SMTP id v39mr1148002qcs.66.1268851657959; Wed, 17 Mar 2010 11:47:37 -0700 (PDT) Received: from localhost.localdomain ([187.15.3.54]) by mx.google.com with ESMTPS id 20sm4899250qyk.0.2010.03.17.11.47.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 17 Mar 2010 11:47:37 -0700 (PDT) X-Mailer: git-send-email 1.7.0.2.277.gc3e85 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Sometimes it is interesting to start a new unparented branch in an existing repository. The new -o/--orphan is intended to solve this situation allowing the creation of a new branch unparented to any other. After the 'checkout -o -b' you are in an new unborn branch ready to be committed which will start a new history without any ancestry. By a 'git commit -a' the commit tree is going to resemble the one from the previous branch. This way you begin a "mostly common paths" work flow. In case you are doing this orphan branch intending to start a "no common paths" work flow then with a 'git rm -rf .' you are ready to go. Signed-off-by: Erick Mattos --- Trying to be concise and more positive on this new option descriptions. :-) Documentation/git-checkout.txt | 18 ++++++++++++++ builtin/checkout.c | 10 ++++++- t/t2017-checkout-orphan.sh | 49 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) create mode 100755 t/t2017-checkout-orphan.sh diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 37c1810..35a6194 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -9,6 +9,7 @@ SYNOPSIS -------- [verse] 'git checkout' [-q] [-f] [-m] [] +'git checkout' [-q] [-f] [-m] [-b [-o]] 'git checkout' [-q] [-f] [-m] [-b ] [] 'git checkout' [-f|--ours|--theirs|-m|--conflict=