Is it possible to preview stash contents in git?

后端 未结 16 1760
后悔当初
后悔当初 2020-12-02 03:34

I often put work away for later, then other stuff comes along, and a few weeks later, I want to inspect the stash, and find out what changes it would make if I applied it to

16条回答
  •  一生所求
    2020-12-02 03:57

    In additional to the existing answers which suggests using (to show the diff of the third-to-last stash)

    git stash show -p stash@{2}
    

    Note that in the git-stash documentation, it is written that

    Stashes may also be referenced by specifying just the stash index (e.g. the integer n is equivalent to stash@{n}).

    Therefore it's also possible to use (this is equivalent to the command above)

    git stash show -p 2
    

    Which should also avoid some Powershell issues.

提交回复
热议问题