3

I expect to be able to z -a z in magit-status and be able to stash pop / z p without problems. However stashing everything in magit apparently does imply saving ignored directories to the stash, but not delete it from the working directory.

The result is that you can't simply pop the stash, since the stash will try to pop files in ignored directories, which are already present.

Replay:

git init 
mkdir ignoreme
touch ignoreme/ignoremefile
git init
echo ignoreme > .gitignore
git add .gitignore
git commit -m "add ignore file"
emacs
  m-x magit-status; z; -a;z
git stash pop
  ignoreme/ignoremefile already exists, no checkout
  Could not restore untracked files from stash
hbogert
  • 4,198
  • 5
  • 24
  • 38

1 Answers1

5

You can run C-u M-x magit-clean or !! clean -xd.

(Your suggested command is missing -x flag. git clean -d will remove untracked, but not ignored, directories. )

Kyle Meyer
  • 1,546
  • 9
  • 10
  • You are right about the `-x`. I updated the Q. It's a pity that magit does not cater to the use-case completely and you still have to use two commands to stash completely. – hbogert Jul 01 '16 at 10:01