{"thread":{"id":"59163","subject":"Git loses untracked files during “stash” if there are conficts","startedAt":"2023-01-31T08:08:44Z","lastAt":"2023-01-31T08:08:44Z","messageCount":1,"participants":["Alessandro Arici"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"471161","messageId":"CAMvf6PPcKQYLWbj1x8P0Y=8rG19i8DNNPG=fCBUvaHLCRKXDmg@mail.gmail.com","threadId":"59163","inReplyTo":null,"subject":"Git loses untracked files during “stash” if there are conficts","fromName":"Alessandro Arici","fromEmail":"alessandro.arici@gmail.com","sentAt":"2023-01-31T08:08:28Z","receivedAt":"2023-01-31T08:08:44Z","isPatch":false,"sender":{"key":"alessandro.arici@gmail.com","avatar":null},"body":"Using git stash -u, but, as title, when there are conflicts untracked\nfiles are gone.\n\nThis is a link, for example:\nhttps://www.databasesandlife.com/git-stash-loses-untracked-files/\n\nAnd this is a reproduction of the bug\n\n# Create a Git repo with a single file committed\ngit init\necho contents > original-file.txt\ngit add original-file.txt\ngit commit -m \"Creating the file\"\n\n# Create a new file, modify an old one, stash\necho foo > new-file.txt\necho contents2 > original-file.txt\ngit stash push -u\n\n# Modify the old file in a different way, commit\necho contents3 > original-file.txt\ngit commit -am \"Altering the file\"\n\n# Apply the stash, see conflict, but what about the new file?\ngit stash pop\ncat new-file.txt\n\n\n\nGit version, on Linux: 2.34.1\n\nThank you\n"}]}