git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Git 1.7.6.557.gcee4] git stash

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Aug 22, 2011, 06:01 UTC
Message-ID
<CAE1pOi1D+J5_fmsdhho1FRAipyO3Ri7GS_wy4fTNtCGbatDaDg@mail.gmail.com>
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

Next: Brandon Casey
Message 1 of 5 in “[Git 1.7.6.557.gcee4] git stash”
  1. Hilco WijbengaAug 22, 2011
  2. Brandon CaseyAug 22, 2011
  3. Hilco WijbengaAug 22, 2011
  4. Brandon CaseyAug 22, 2011
  5. Hilco WijbengaAug 22, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.