From: Erick Mattos Date: Wed, 17 Mar 2010 18:46:24 GMT Subject: [PATCH v4] git checkout -b: unparent the new branch with -o Message-ID: <1268851584-10988-1-git-send-email-erick.mattos@gmail.com> 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=