I earlier ran git stash push -u ...
to include an untracked file in the stash. Now, I've confirmed that this stash, stash@{2}
, includes this untracked file (and tracked file changes). But, when I run git stash apply 2
, only the tracked files get applied. (note: there were a couple of merge conflicts with some of the tracked files)
I didn't change any directory structure or replace this untracked file since this stash, so it should be able to be easily placed back where it was.
Why isn't the untracked file getting applied?
Thanks for any help!
--
Here, I applied the stash:
$ git stash apply 2
Auto-merging <file1>
CONFLICT (content): Merge conflict in <file1>
Auto-merging <file2>
CONFLICT (content): Merge conflict in <file2>
The untracked file is missing at this point, but I resolve the conflicts, then run:
$ git restore --staged .
The stash apply has been completed, but the untracked file is still missing.
Update
According to this article, it seems that this could possibly be a bug introduced between Git 2.24
and 2.33
(and git --version
tells me I'm using 2.34.1
). However, I'm not sure if this is very likely since I feel like this problem would have more attention, given that git 2.33
apparently released almost 2 years ago (Aug 16, 2021
).