On the git stash manpage you can read (in the "Discussion" section, just after "Options" description) that: A stash is represented as a commit whose tree records the state of the working directory,... Read More
No and No. git stash is per-repository. Here is a nice page on how to use it.... Read More
Try using How to recover a dropped stash in Git? to find the stash you popped. I think there are always two commits for a stash, since it preserves the index and the working copy (so often the index... Read More
I managed to recreate your issue. It seems if you stash untracked files and then you create those files (in your example, foo.txt and bar.txt), then you have local changes to untracked files that wou... Read More
For Git 2.6+ (released 28 Sept 2015) The ~~only~~ git config setting which would be of interest is: rebase.autoStash (with Git 2.27, Q2 2020, you now also have merge.autostash , see below) When set... Read More
EDIT: Since git 2.13, there is a command to save a specific path to the stash: git stash push <path>. For example: git stash push -m welcome_cart app/views/cart/welcome.thtml OLD ANSWER: You can do... Read More
This happens for me any time I try to split a hunk into smaller hunks that are too close together (less than 3 lines between changes). The short explanation is that the patch has context lines in it... Read More
No need to stash. git checkout -b new_branch_name does not touch your local changes. It just creates the branch from the current HEAD and sets the HEAD there. So I guess that's what you want. --- Ed... Read More
As mentioned below, and detailed in "How would I extract a single file (or changes to a file) from a git stash?", you can apply use git checkout or git show to restore a specific file. git checkout s... Read More
When I have to apply stashed changes to a dirty working copy, e.g. pop more than one changeset from the stash, I use the following: $ git stash show -p | git apply -3 && git stash drop Basically it... Read More