In git, is there a way to show untracked stashed files without applying the stash?

前端 未结 5 1495
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 06:28

If I run git stash -u, I can stash untracked files. However, said untracked files don\'t show up at all with git stash show stash@{0}. Is there

5条回答
  •  既然无缘
    2020-12-04 06:53

    A workaround: Staging files before stashing them will make git stash show -p work as expected.

    git add .
    git stash save
    

    Note: This way gives the power adding interactive portions too, here is how.
    Caution: Ensure you don't have previously staged work, or you won't be able to distinguish it.
    This may be of use.

提交回复
热议问题