emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Git help requested: "git stash pop" is doing an unwanted "git add".


From: David Kastrup
Subject: Re: Git help requested: "git stash pop" is doing an unwanted "git add". Why?
Date: Sun, 20 Dec 2015 23:48:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Alan Mackenzie <address@hidden> writes:

> Hello, Emacs.
>
> I'm clearing out a "stash stack" in my master repository copy.  I've
> just done "git stash pop", expecting git to pop the changes into my
> working directory.
>
> Well, there were 2 files with conflicts - fair enough.  But with all the
> other files, git has had the cheek to do a "git add" (I think the jargon
> for this is "moved the files to the staging area"), leaving me with the
> hassle of doing a "git reset" on quite a lot of files.
>
> Why has the "git stash pop" done this, and how can I call "git stash
> pop" in the future, avoiding this annoying problem?

git stash saves both work directory changes as well as already staged
files.  git stash pop restores both.  So you likely git-added some files
before stashing.  Personally, I prefer to create commits (that I'll
amend afterwards) to stashes once I progressed far enough to actually
add stuff to the index.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]