file deletion in index lost after checkout -b

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux