From: Erick Mattos Date: Tue, 09 Mar 2010 22:28:33 GMT Subject: [PATCH v2] git checkout -b: unparent the new branch with -o Message-ID: <1268173713-5224-1-git-send-email-erick.mattos@gmail.com> Sometimes it is necessary to start up a new development branch of code intended to be merged in the near future to existing branches but which actually does not relate to them. 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' the new branch is not saved until some files are added to the index and committed, exactly as if it was an initial commit. A 'git clean -df' would delete everything from the work tree making it empty for new files. Signed-off-by: Erick Mattos --- Changed the text in SYNOPSIS to correct it as noticed by Jakub Narebski. Regards Documentation/git-checkout.txt | 10 ++++++++ builtin-checkout.c | 14 +++++++++- t/t2017-checkout-orphan.sh | 50 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 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..c13ab62 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=