git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* file deletion in index lost after checkout -b
@ 2008-09-01  3:44 Jing Xue
  2008-09-05  6:12 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Jing Xue @ 2008-09-01  3:44 UTC (permalink / raw)
  To: git

In Git 1.6.0 the following sequence:

$ git init
$ echo 'abcdefgh' >1.txt
$ echo '12345678' >2.txt
$ git add 1.txt 2.txt
$ git commit -m 'init'
$ git rm 2.txt
$ echo 'qwertyuiop' >>1.txt
$ git add 1.txt
$ echo 'asdfghjkl;' >3.txt
$ git add 3.txt
$ git status
$ git checkout -b foo
$ git status

produces this output:

Initialized empty Git repository in /home/jingxue/workspace/sandboxes/test.git/.git/
Created initial commit 918f3c6: init
 2 files changed, 2 insertions(+), 0 deletions(-)
 create mode 100644 1.txt
 create mode 100644 2.txt
rm '2.txt'
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   1.txt
#       deleted:    2.txt
#       new file:   3.txt
#
M       1.txt
A       3.txt
Switched to a new branch "foo"
# On branch foo
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   1.txt
#       new file:   3.txt
#

The deletion of 2.txt appears lost during 'checkout -b foo', while the
modification and addition were both brought over. Is it a bug?

Cheers.
-- 
Jing Xue

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

end of thread, other threads:[~2008-09-09  2:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-01  3:44 file deletion in index lost after checkout -b Jing Xue
2008-09-05  6:12 ` Junio C Hamano
2008-09-06 17:11   ` Jing Xue
2008-09-06 18:10     ` Junio C Hamano
2008-09-08  2:49   ` Re* " Junio C Hamano
2008-09-09  2:06     ` Jing Xue

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).