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

[PATCH v2] git-checkout.txt: Document "git checkout <pathspec>" better

From
Torsten Bögershausen <tboegi@web.de>
Date
Jun 17, 2015, 07:54 UTC
Message-ID
<558127CB.70603@web.de>
git checkout <pathspec> can be used to reset changes in the working tree.
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
Version 2: Try to summarize the suggestions from the mailing list
 Documentation/git-checkout.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index d263a56..39ad36f 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -3,7 +3,7 @@ git-checkout(1)
  NAME
 ----
-git-checkout - Checkout a branch or paths to the working tree
+git-checkout - Switch branches or restore changes
  SYNOPSIS
 --------
@@ -89,6 +89,10 @@ Omitting <branch> detaches HEAD at the tip of the current branch.
 	(i.e.  commit, tag or tree) to update the index for the given
 	paths before updating the working tree.
 +
+'git checkout' with <paths> or `--patch` is used to restore modified or
+deleted paths to their original contents from the index or replace paths
+with the contents from a named <tree-ish> (most often a commit-ish).
++
 The index may contain unmerged entries because of a previous failed merge.
 By default, if you try to check out such an entry from the index, the
 checkout operation will fail and nothing will be checked out.
-- 
2.2.0.rc1.790.ge19fcd2
Next: Duy Nguyen
Message 1 of 20 in “git-checkout.txt: Document "git checkout <pathspec>" better”
  1. git-checkout.txt: Document "git checkout <pathspec>" betterTorsten Bögershausen, Jun 17, 2015
  2. Duy NguyenJun 17, 2015
  3. Matthieu MoyJun 17, 2015
  4. Andres G. AragonesesJun 17, 2015
  5. Matthieu MoyJun 17, 2015
  6. Andres G. AragonesesJun 17, 2015
  7. Matthieu MoyJun 17, 2015
  8. Junio C HamanoJun 17, 2015
  9. Torsten BögershausenJun 17, 2015
  10. Junio C HamanoJun 17, 2015
  11. Torsten BögershausenJun 17, 2015
  12. Matthieu MoyJun 17, 2015
  13. Andres G. AragonesesJun 17, 2015
  14. Junio C HamanoJun 17, 2015
  15. Junio C HamanoJun 17, 2015
  16. Torsten BögershausenJun 17, 2015
  17. Junio C HamanoJun 17, 2015
  18. Duy NguyenJun 18, 2015
  19. Junio C HamanoJun 18, 2015
  20. Matthieu MoyJun 18, 2015

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.