{"thread":{"id":"50064","subject":"bugreport: git checkout --recurse-submodules overwrites unstaged changes","startedAt":"2018-12-19T07:26:07Z","lastAt":"2018-12-19T07:26:07Z","messageCount":1,"participants":["Petr Gregor"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"365565","messageId":"CAHsG2VT4YB_nf8PrEmrHwK-iY-AQo0VDcvXGVsf8cEYXws4nig@mail.gmail.com","threadId":"50064","inReplyTo":null,"subject":"bugreport: git checkout --recurse-submodules overwrites unstaged changes","fromName":"Petr Gregor","fromEmail":"gregy@gregy.cz","sentAt":"2018-12-19T07:25:53Z","receivedAt":"2018-12-19T07:26:07Z","isPatch":false,"sender":{"key":"gregy@gregy.cz","avatar":null},"body":"Hello,\nI believe we found a reproducible bug in git checkout\n--recurse-submodules command. Documentation says, that this command\nshould not overwrite unstaged changes in submodules unless -f is\ngiven. In reality local changes can be accidentally overwritten even\nwithout -f flag.\n\nI reproduced the issue with git version 2.20.1 like this:\n\ngit init\ngit submodule add https://github.com/Gregy/znapzend-debian submodule\ngit add . && git commit -m 'first'\ngit checkout -b 'newbranch'\n(cd submodule && git checkout a3a7b0)\ngit add . && git commit -m 'set new branch to different submodule commit'\necho 'test' > submodule/debian/compat #create an unstaged change\ngit checkout master --recurse-submodules\n#my change is overwritten\n\nThank you for maintaining git, it is awesome!\n\nPetr Gregor\n"}]}