git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/5] Documentation: alter checkout --orphan description

From
Erick Mattos <erick.mattos@gmail.com>
Date
May 22, 2010, 00:28 UTC
Message-ID
<1274488119-6989-2-git-send-email-erick.mattos@gmail.com>
In-Reply-To
<1274488119-6989-1-git-send-email-erick.mattos@gmail.com>
The present text is a try to enhance description accuracy.  It is a
merge of the rewritten text made by native english speaker Chris Johnsen
and further changes of Junio.  It came from the last thread messages of
--orphan patch.
---
 Documentation/git-checkout.txt |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 4505eb6..b84ec26 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -91,22 +91,29 @@ explicitly give a name with '-b' in such a case.
 	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.
+	Create a new 'orphan' branch, named <new_branch>, started from
+	<start_point> and switch to it.  The first commit made on this
+	new branch will have no parents and it will be the root of a new
+	history totally disconnected from all the other branches and
+	commits.
 +
-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.
+The index and the working tree are adjusted as if you had previously run
+"git checkout <start_point>".  This allows you to start a new history
+that records a set of paths similar to <start_point> by easily running
+"git commit -a" to make the root commit.
 +
-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.
+This can be useful when you want to publish the tree from a commit
+without exposing its full history. You might want to do this to publish
+an open source branch of a project whose current tree is "clean", but
+whose full history contains proprietary or otherwise encumbered bits of
+code.
++
+If you want to start a disconnected history that records a set of paths
+that is totally different from the one of <start_point>, then you should
+clear the index and the working tree right after creating the orphan
+branch by running "git rm -rf ." from the top level of the working tree.
+Afterwards you will be ready to prepare your new files, repopulating the
+working tree, by copying them from elsewhere, extracting a tarball, etc.
 
 -m::
 --merge::
-- 
1.7.1.231.g0687c.dirty
Previous: Erick MattosNext: Erick Mattos
Message 2 of 18 in “checkout --orphan improvements”
  1. 0/5 checkout --orphan improvementsErick Mattos, May 22, 2010
  2. 1/5 Documentation: alter checkout --orphan descriptionErick Mattos, May 22, 2010
  3. 2/5 refs: split log_ref_write logic into log_ref_setupErick Mattos, May 22, 2010
  4. Junio C HamanoMay 26, 2010
  5. Erick MattosMay 26, 2010
  6. Junio C HamanoJun 2, 2010
  7. Erick MattosJun 2, 2010
  8. 3/5 checkout --orphan: respect -l option alwaysErick Mattos, May 22, 2010
  9. Junio C HamanoMay 26, 2010
  10. Erick MattosMay 26, 2010
  11. Erik Faye-LundMay 26, 2010
  12. Erick MattosMay 26, 2010
  13. Erick MattosJun 3, 2010
  14. Michael J GruberMay 26, 2010
  15. Erick MattosMay 26, 2010
  16. Michael J GruberMay 27, 2010
  17. 4/5 t3200: test -l with core.logAllRefUpdates optionsErick Mattos, May 22, 2010
  18. 5/5 bash completion: add --orphan to 'git checkout'Erick Mattos, May 22, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.