git stash
sometimes you have to see details what have been stored in you local git stash index. Can we see what changes have we stored in git stash index?
YES, there is a way to do this.
a small background about git stash
git stash
- the command stash the changes in a dirty working directory away and store them in a stash index which could be dropped or reapply or stay forever as per the user preferences
Back to the original problem that how can we see the stash changes?
To see the stash changes we can make use of git stash show
command.
we can read more on man pages
# read more about git stash using man
man git-stash
git stash show
Show the changes recorded in the stash entry as a diff between the stashed contents and the commit back when the stash entry was first created. When no stash index is given, it shows the latest one. By default, the command shows the diffstat, but it will accept any format known to git diff (e.g., git stash show -p stash@{1} to view the second most recent entry in patch form).
# use the command with --patch option to see
# what changes for individual files those have stashed.
git stash show --patch
I use it very frequently as I screw things a lot 😜
we can use all possible option available with git diff
command with git stash show <option>
command. Like to get more details on git diff command read more about git diff