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

[PATCH] Make "git checkout <branch> <path>" work when <path> is a directory.

From
MEMichael K. Edwards <medwards.linux@gmail.com>
Date
Nov 17, 2006, 05:49 UTC
Message-ID
<f2b55d220611162149m719079f3ubdaeac43fe9798cb@mail.gmail.com>
This improves the workflow for, say, kernel subsystem backporting.
Signed-off-by: Michael K. Edwards <medwards-linux@gmail.com>
---
 git-checkout.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-checkout.sh b/git-checkout.sh
index dd47724..5866604 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -106,7 +106,8 @@ Did you intend to checkout '$@' which ca
 		git-ls-tree --full-name -r "$new" "$@" |
 		git-update-index --index-info || exit $?
 	fi
-	git-checkout-index -f -u -- "$@"
+	git-ls-files "$@" |
+	git-checkout-index -f -u --stdin
 	exit $?
 else
 	# Make sure we did not fall back on $arg^{tree} codepath
Next: Junio C Hamano
Message 1 of 4 in “Make "git checkout <branch> <path>" work when <path> is a directory.”
  1. Make "git checkout <branch> <path>" work when <path> is a directory.Michael K. Edwards, Nov 17, 2006
  2. Junio C HamanoNov 17, 2006
  3. Michael K. EdwardsNov 17, 2006
  4. Junio C HamanoNov 17, 2006

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.