stash

Git stash: "Cannot apply to a dirty working tree, please stage your changes"

I am trying to apply changes I stashed earlier with git stash pop and get the message: Cannot apply to a dirty working tree, please stage your changes Any suggestion on how to deal with that? ...

How to emulate 'git stash' in fossil, bzr?

Is it possible to emulate the behavior of 'git stash' when using fossil/bzr? Basically I'm interested in handling the following workflow: at some point the source code tree has state X, it is commited I proceed to writing new code, I write it for a while and I see the opportunity of a refactoring I can't commit at this point, because ...

GIT: Do I need to commit my branch before checking out another branch, what about Stash?

I'm new to Git and a bit confused. I have Master branch and have created a second feature branch. If I make changes in my feature branch and then switch to Master, will my changes be lost if I don't commit? Where does stash come into play, is it something you do before you switch branches (but don't want to commit) or is it to sim...

Git: Create a branch from unstagged/uncommited changes on master

Context: I'm working on master adding a simple feature. After a few minutes I realize it was not so simple and it should have been better to work into a new branch. This always happens to me and I have no idea how to switch to another branch and take all these uncommited changes with me leaving the master branch clean. I supposed git st...

Strange git case - git stash followed by git stash apply lost uncommitted data?

I have a file, let's say file.txt I have done git mv file.txt to file1.txt, then I created a new file called file.txt and worked on it. Unfortunately I didn't add that file to git yet. Anyway the problem is that I did git stash, then git stash apply, but the new file.txt disappeared... anyway to get it back? ...

Is it possible to preview stash appplication in git?

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 working tree in its current state. I know I can do a git diff on the stash, but this shows me all the differences between the working tree and the stash, whereas I'...