How can I see the changes un-stashing will make to the current working tree? I would like to know what changes will be made before applying them!
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
This works for me on git version 1.8.5.2:
One way to do this without moving anything is to take advantage of the fact that
patch
can read git diff's (unified diffs basically)This will show you a step-by-step preview of what patch would ordinarily do. The added benefit to this is that patch won't prevent itself from writing the patch to the working tree either, if for some reason you just really need git to shut up about commiting-before-modifying, go ahead and remove --dry-run and follow the verbose instructions.
She the list of stash
So get the stash number and do:
You can do:
But if you want a diff (this is different to show the stash, that's why I write this answer.
Diff
consider the current code in your branch andshow
just show what you will apply)You can use:
or
Another interesting thing to do is:
This applies the stash without removing it from the list, you can
git checkout .
to remove those change or if you are happygit stash drop stash@{10}
to remove a stash from the list.From here I never recommend to use
git stash pop
and use a combination ofgit stash apply
andgit stash drop
If you apply a stash in the wrong branch... well sometimes is difficult to recover your code.If the branch that your stashed changes are based on has changed in the meantime, this command may be useful:
This compares the stash against the commit it is based on.
To see the most recent stash:
To see an arbitrary stash:
Also, I use git diff to compare the stash with any branch.
You can use:
To see all changes compared to branch master.
Or You can use:
To easy find only changed file names.
If you have tools for diff (like beyond compare)