Package: git Version: 1:1.7.10-1 Severity: normal Hello,
thank you for maintaining git. While setting up a new repository, I stumbled into a sequence of commands that, although it has an obvious mistake in it, surprisingly causes data loss. # Let's create a new repo $ mkdir rep1 $ cd rep1 rep1$ git init Initialized empty Git repository in /home/enrico/rep1/.git/ # Let's add an important file to it rep1$ echo "important data" > important-file rep1$ git add important-file # Whoops! Forgot to commit. # Let's create another repo (or clone rep1 to rep2) rep1$ cd .. $ mkdir rep2 $ cd rep2 rep2$ git init Initialized empty Git repository in /home/enrico/rep2/.git/ # Let's add a file on the other repo rep2$ touch silly-file rep2$ git add silly-file rep2$ git commit -m "Added silly file" [master (root-commit) 74e9d18] Added silly file 0 files changed create mode 100644 silly-file # Let's pull rep2 into rep1 rep2$ cd ../rep1 rep1$ git remote add rep2 ../rep2/ rep1$ git pull rep2 master remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From ../rep2 * branch master -> FETCH_HEAD # Let's have a look and panic rep1$ ls -la total 12 drwxr-xr-x 3 enrico enrico 4096 May 2 12:42 . drwxr-xr-x 4 enrico enrico 4096 May 2 12:41 .. drwxr-xr-x 8 enrico enrico 4096 May 2 12:42 .git -rw-r--r-- 1 enrico enrico 0 May 2 12:42 silly-file rep1$ git st # On branch master nothing to commit (working directory clean) # HELP! Where has important-file gone? Although that stage was uncommitted, that it could be lost with all its contents over a pull looks like a bug. Ciao, Enrico -- System Information: Debian Release: wheezy/sid APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages git depends on: ii git-man 1:1.7.10-1 ii libc6 2.13-30 ii libcurl3-gnutls 7.25.0-1 ii liberror-perl 0.17-1 ii libexpat1 2.1.0-1 ii perl-modules 5.14.2-9 ii zlib1g 1:1.2.6.dfsg-2 Versions of packages git recommends: ii less 444-2 ii openssh-client [ssh-client] 1:5.9p1-5 ii patch 2.6.1-3 ii rsync 3.0.9-1 Versions of packages git suggests: pn gettext-base 0.18.1.1-5 pn git-arch <none> pn git-cvs <none> pn git-daemon-run | git-daemon-sysvinit <none> pn git-doc 1:1.7.10-1 pn git-el <none> pn git-email <none> pn git-gui <none> pn git-svn 1:1.7.10-1 pn gitk 1:1.7.10-1 pn gitweb <none> -- no debconf information -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

