summaryrefslogtreecommitdiffstats
path: root/git-checkout.txt
diff options
context:
space:
mode:
authorJunio C Hamano <junio@kernel.org>2010-05-21 14:57:53 +0000
committerJunio C Hamano <junio@kernel.org>2010-05-21 14:57:53 +0000
commitcc7636a7aa705986cedababd3173cad477491003 (patch)
treed5f2c5aeadb840264c0881528637d5c124b615a7 /git-checkout.txt
parente97d5771c3fcb22302e27b6f962375a059cdcb13 (diff)
downloadgit-htmldocs-cc7636a7aa705986cedababd3173cad477491003.tar.gz
Autogenerated HTML docs for v1.7.1-226-g770c5
Diffstat (limited to 'git-checkout.txt')
-rw-r--r--git-checkout.txt20
1 files changed, 19 insertions, 1 deletions
diff --git a/git-checkout.txt b/git-checkout.txt
index 37c1810e3..4505eb6d8 100644
--- a/git-checkout.txt
+++ b/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,