git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jing Xue <jingxue@digizenstudio.com>
To: git <git@vger.kernel.org>
Subject: file deletion in index lost after checkout -b
Date: Sun, 31 Aug 2008 23:44:14 -0400	[thread overview]
Message-ID: <20080901034414.GR6619@jabba.hq.digizenstudio.com> (raw)

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

             reply	other threads:[~2008-09-01  3:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01  3:44 Jing Xue [this message]
2008-09-05  6:12 ` file deletion in index lost after checkout -b 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080901034414.GR6619@jabba.hq.digizenstudio.com \
    --to=jingxue@digizenstudio.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).