git stash — removing untracked files

前端 未结 1 1886
刺人心
刺人心 2021-01-27 00:43

Today at work, one of my colleagues noticed that doing a git stash while providing the file path removes the untracked files.

git stash -- src/

1条回答
  •  太阳男子
    2021-01-27 01:12

    This was in fact a bug, fixed in commit bba067d2faf047597bc76f885fb0cf87894b5ed1 by Thomas Gummerer. This means you need Git v2.16.2 or later to have the fix. The bug was introduced in commit df6bba0937209d679a06affffd26975593fef744f2, which means Git v2.13.0 or later.

    (To avoid the bug, don't stash by pathspec. The stash-by-pathspec feature was new in Git v2.13.0, in the very same commit that has the bug.)

    0 讨论(0)
提交回复
热议问题