Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

[Git 1.7.6.557.gcee4] git stash

From: Hilco Wijbenga <hidden>
Date: 2016-06-15 22:51:51

Hi David,

I noticed your very timely change to git stash in the current master
branch. I tried it but it doesn't behave as I was expecting/hoping.

hilco@centaur ~/tmp/repo repo$ git --version
git version 1.7.6.557.gcee4
hilco@centaur ~/tmp/repo repo$ git init
Initialized empty Git repository in /home/hilco/tmp/repo/.git/
hilco@centaur ~/tmp/repo repo (master #)$ cat >>.gitignore <<- EOF
        *.ignore
        ignore-dir/
EOF
hilco@centaur ~/tmp/repo repo (master #%)$ mkdir src
hilco@centaur ~/tmp/repo repo (master #%)$ touch file.txt src/code.txt
hilco@centaur ~/tmp/repo repo (master #%)$ git add -A .
hilco@centaur ~/tmp/repo repo (master #)$ git commit -m '1'
[master (root-commit) 0fb4106] 1
 1 files changed, 2 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
 create mode 100644 file.txt
 create mode 100644 src/code.txt
hilco@centaur ~/tmp/repo repo (master)$ touch file-a.ignore src/file-b.ignore
hilco@centaur ~/tmp/repo repo (master %)$ echo "hello">src/code.txt
hilco@centaur ~/tmp/repo repo (master *%)$ mkdir ignore-dir
hilco@centaur ~/tmp/repo repo (master *%)$ touch
ignore-dir/{file.ignore,file.txt}
hilco@centaur ~/tmp/repo repo (master *%)$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   src/code.txt
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       file-a.ignore
#       ignore-dir/
#       src/file-b.ignore
no changes added to commit (use "git add" and/or "git commit -a")
hilco@centaur ~/tmp/repo repo (master *%)$ git stash --no-keep-index --all
Saved working directory and index state WIP on master: 0fb4106 1
HEAD is now at 0fb4106 1
Not removing ignore-dir/
hilco@centaur ~/tmp/repo repo (master $%)$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       ignore-dir/
nothing added to commit but untracked files present (use "git add" to track)

So it quite explicitly states "Not removing ignore-dir/". How do I
make sure it also stashes the ignore-dir directory?

Cheers,
Hilco
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help