I am learning and practicing git. what i have learned about stashing is, "I am working on a branch and if i have to checkout to another branch but do not want to commit the incomplete work which i was working on, then I should stash that and checkout to other branch. After coming back to stashed branch i have to 'stash apply' and then i can work on my previous incomplete work again". Is that completely right? Now when I was testing this, I did something little strange. I created a file and write something and add this to lets say branch 'A', then i stashed and checkout to master branch and command 'git stash apply' and then the file which i added to my branch 'A' and stashed, i now visible in branch.
Now My question is,
- Why new file is visible at master branch?, (as i added and stashed it to branch 'A')
- Isn't git add(for and unmarked file) means started to mark a new file for a particular branch?
- Isn't stashing means saving 'incomplete marked work' for a particular branch?
Sorry for writing something which might be silly. But I really wanna understand. Thanks.