From: Erick Mattos Date: Sun, 21 Mar 2010 15:34:38 +0000 (-0300) Subject: git checkout: create unparented branch by --orphan X-Git-Tag: v1.7.2-rc0~131^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9db5ebf4022d8e11ac20e75a3d43af161b752fcd;p=git.git git checkout: create unparented branch by --orphan Similar to -b, --orphan creates a new branch, but it starts without any commit. After running "git checkout --orphan newbranch", you are on a new branch "newbranch", and the first commit you create from this state will start a new history without any ancestry. "git checkout --orphan" keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch. When creating a branch whose trees have no resemblance to the ones from the original branch, it may be easier to start work on the new branch by untracking and removing all working tree files that came from the original branch, by running a 'git rm -rf .' immediately after running "checkout --orphan". Signed-off-by: Erick Mattos Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 37c1810e3..4505eb6d8 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git checkout' [-q] [-f] [-m] [] -'git checkout' [-q] [-f] [-m] [-b ] [] +'git checkout' [-q] [-f] [-m] [[-b|--orphan] ] [] 'git checkout' [-f|--ours|--theirs|-m|--conflict=