summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-05-21 04:02:14 -0700
committerJunio C Hamano <gitster@pobox.com>2010-05-21 04:02:14 -0700
commite2ab0227aab5cdcede3b39e4c95b118f09a71d29 (patch)
treeb066fb12c3e9f50c18d6e26086e277c978487228 /Documentation
parent1be270cbdfd46a34fb8ce39ec31bb593137096fc (diff)
parent9db5ebf4022d8e11ac20e75a3d43af161b752fcd (diff)
downloadgit-e2ab0227aab5cdcede3b39e4c95b118f09a71d29.tar.gz
Merge branch 'em/checkout-orphan'
* em/checkout-orphan: git checkout: create unparented branch by --orphan
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-checkout.txt20
1 files changed, 19 insertions, 1 deletions
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 37c1810e3f..4505eb6d84 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git checkout' [-q] [-f] [-m] [<branch>]
-'git checkout' [-q] [-f] [-m] [-b <new_branch>] [<start_point>]
+'git checkout' [-q] [-f] [-m] [[-b|--orphan] <new_branch>] [<start_point>]
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
'git checkout' --patch [<tree-ish>] [--] [<paths>...]
@@ -90,6 +90,24 @@ explicitly give a name with '-b' in such a case.
Create the new branch's reflog; see linkgit:git-branch[1] for
details.
+--orphan::
+ Create a new branch named <new_branch>, unparented to any other
+ branch. The new branch you switch to does not have any commit
+ and after the first one it will become the root of a new history
+ completely unconnected from all the other branches.
++
+When you use "--orphan", the index and the working tree are kept intact.
+This allows you to start a new history that records set of paths similar
+to that of the start-point commit, which is useful when you want to keep
+different branches for different audiences you are working to like when
+you have an open source and commercial versions of a software, for example.
++
+If you want to start a disconnected history that records set of paths
+totally different from the original branch, you may want to first clear
+the index and the working tree, by running "git rm -rf ." from the
+top-level of the working tree, before preparing your files (by copying
+from elsewhere, extracting a tarball, etc.) in the working tree.
+
-m::
--merge::
When switching branches,