Is it possible to preview stash contents in git?

后端 未结 16 1759
后悔当初
后悔当初 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 04:01

    I'm a fan of gitk's graphical UI to visualize git repos. You can view the last item stashed with:

    gitk stash
    

    You can also use view any of your stashed changes (as listed by git stash list). For example:

    gitk stash@{2}
    

    In the below screenshot, you can see the stash as a commit in the upper-left, when and where it came from in commit history, the list of files modified on the bottom right, and the line-by-line diff in the lower-left. All while the stash is still tucked away.

    gitk viewing a stash

提交回复
热议问题