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

git add -N vs. git stash

From
UKUwe Kleine-König <uwe@kleine-koenig.org>
Date
Aug 8, 2022, 16:39 UTC
Message-ID
<20220808163954.tnozlrv7nyx63imu@pengutronix.de>
Hello,
somehow git stash doesn't understand the index after git add -N:
	$ git version
	git version 2.36.1
	$ git init -q
	$ echo foo > foo
	$ git add foo
	$ git commit -a -m .
	[main (root-commit) 0e4b48cb4913] .
	 1 file changed, 1 insertion(+)
	 create mode 100644 foo
	$ echo bar > bar
	$ git add -N bar
	$ git stash push
	error: Entry 'bar' not uptodate. Cannot merge.
	Cannot save the current worktree state
I'd say that's not a feature, is it?

I would have expected the last command to just remove bar from the index.

Best regards Uwe

Next: Junio C Hamano
Message 1 of 2 in “git add -N vs. git stash”
  1. Uwe Kleine-KönigAug 8, 2022
  2. Junio C HamanoAug 8, 2022

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.