[Ilugc] [ilugc] Doubt in Git stashing

  • From: manokaran@xxxxxxxxx (Manokaran K)
  • Date: Mon, 24 Aug 2015 13:31:27 +0000


On Mon, Aug 24, 2015 at 4:50 PM, Priya K <priyacst at gmail.com> wrote:

Say, first I have some commits in my *master* branch.
Now I create a branch named *new*.
I do some changes in *new* branch.

Now I want to checkout to *master* branch without committing the changes.
So when I checkout, it should show an error for stashing. But no error
occurs, it checked-out to *master* branch.

Actually,
First I have to do a commit in *new* branch. Then I do some changes in a
file. In this case only, when I try to checkout, an error occurs for
stashing.

I don't know why a commit is necessary before stashing.



Assuming that you 'git add'ed all the changed files, after a commit you'll
have nothing to stash! It would help if you post the output of 'git status'
before and after commit and before and after stash.

Cheers,
mano

Other related posts: