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

git stash doesn't handle submodules with modifications

From
Steffen Prohaska <prohaska@zib.de>
Date
Aug 10, 2007, 06:24 UTC
Message-ID
<B6C5D5E2-6EBA-427A-8B79-C545BB23226B@zib.de>

Stash in combination with a submodule does not work as expected. A submodule with modifications is not handled correctly if it has modifications.

I started with some changes in the working tree and with a submodule having changes, too. I do 'git stash', which stashes away all my changes to the working tree, but it does not store changes to the submodule. Thus, 'git status' still shows a modified submodule.

'git apply' refuses to work with a modified submodule with: 'Cannot restore on top of a dirty state'.

So, I have stashed my changes, but can't get them back easily. This happend to me in the msysgit repo, which includes git as a submodule.

What would be the right way to solve this? I'd expect that stash somehow would ignore the submodule. But it may be more correct to include the submodule into the stash?

	Steffen
Message 1 of 1 in “git stash doesn't handle submodules with modifications”
  1. Steffen ProhaskaAug 10, 2007

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.