# git stash doesn't handle submodules with modifications

1 messages from 2007-08-10 to 2007-08-10. Participants: Steffen Prohaska.
Thread: https://gitlist.dev/t/9465

## Steffen Prohaska, 2007-08-10 06:24

Subject: git stash doesn't handle submodules with modifications
Message-ID: <B6C5D5E2-6EBA-427A-8B79-C545BB23226B@zib.de>
URL: https://gitlist.dev/e/B6C5D5E2-6EBA-427A-8B79-C545BB23226B%40zib.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

```
