git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git stash data loss
@ 2012-07-27  3:06 Aleksandr Pryimak
  2012-07-27 13:29 ` Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: Aleksandr Pryimak @ 2012-07-27  3:06 UTC (permalink / raw)
  To: git

Hello.

It is believed that
git stash
git stash pop
is safe to-do operation. But sometimes it is not. For example here is an example http://stackoverflow.com/questions/11680453/git-stash-where-did-the-files-in-my-directory-go/11680645

I also recreated it

aleksandr@beast:/tmp/test$ git init
Initialized empty Git repository in /tmp/test/.git/
aleksandr@beast:/tmp/test$ touch x
aleksandr@beast:/tmp/test$ git add x
aleksandr@beast:/tmp/test$ git commit -m "Initial"
[master (root-commit) d3569a0] Initial
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 x
aleksandr@beast:/tmp/test$ rm x
aleksandr@beast:/tmp/test$ mkdir x/
aleksandr@beast:/tmp/test$ ls
x
aleksandr@beast:/tmp/test$ git stash
Saved working directory and index state WIP on master: d3569a0 Initial
HEAD is now at d3569a0 Initial
aleksandr@beast:/tmp/test$ ls
x
aleksandr@beast:/tmp/test$ git stash pop
Removing x
# On branch master
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	deleted:    x
#
no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (c500443ae16cf0d846b195cb97eb388dec5f440e)
aleksandr@beast:/tmp/test$ ls
aleksandr@beast:/tmp/test$ git --version
git version 1.7.5.4

--
Aleksandr Pryimak

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-09-14 23:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-27  3:06 git stash data loss Aleksandr Pryimak
2012-07-27 13:29 ` Jeff King
2012-07-27 13:50   ` Jeff King
2012-08-17  3:30     ` Junio C Hamano
2012-08-21  6:55       ` Jeff King
2012-09-14 23:04         ` Junio C Hamano
2012-07-27 14:21   ` Aleksandr Priymak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).