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

[BUG?] git checkout $commit -- somedir doesn't drop files

From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date
Sep 17, 2013, 19:06 UTC
Message-ID
<20130917190659.GA15588@pengutronix.de>
Hello,
after these commands:
	$ git init
	$ mkdir subdir
	$ echo a > subdir/a
	$ git add subdir/a
	$ git commit -m a
	$ echo more a >> subdir/a
	$ echo b > subdir/b
	$ git add subdir/*
	$ git commit -m b
	$ git checkout HEAD^ -- subdir

I'd expect that subdir/b is removed from the index as this file didn't exist in HEAD^ but git-status only reports:

	# On branch master
	# Changes to be committed:
	#   (use "git reset HEAD <file>..." to unstage)
	#
	#	modified:   subdir/a
	#
Is this intended?

(I'm using git 1.8.4.rc3 as shipped by Debian (package version 1:1.8.4~rc3-1).)

Best regards Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Next: Junio C Hamano
Message 1 of 15 in “[BUG?] git checkout $commit -- somedir doesn't drop files”
  1. Uwe Kleine-KönigSep 17, 2013
  2. Junio C HamanoSep 17, 2013
  3. Jeff KingSep 17, 2013
  4. Junio C HamanoSep 17, 2013
  5. Jeff KingSep 17, 2013
  6. Junio C HamanoSep 17, 2013
  7. Jeff KingSep 17, 2013
  8. Junio C HamanoSep 17, 2013
  9. Jeff KingSep 17, 2013
  10. Junio C HamanoSep 17, 2013
  11. Jeff KingSep 19, 2013
  12. Junio C HamanoSep 19, 2013
  13. Jeff KingSep 19, 2013
  14. Junio C HamanoSep 20, 2013
  15. Jeff KingSep 17, 2013

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.