# git fast-import / working tree status question

2 messages from 2010-02-19 to 2010-02-19. Participants: Mike Fleetwood, Shawn Pearce.
Thread: https://gitlist.dev/t/22735

## Mike Fleetwood, 2010-02-19 23:20

Subject: git fast-import / working tree status question
Message-ID: <fc5ef2e01002191520u7b50c98fo3a3defe70e31292a@mail.gmail.com>
URL: https://gitlist.dev/e/fc5ef2e01002191520u7b50c98fo3a3defe70e31292a%40mail.gmail.com

```
Hi,

I am a newbie using git and I am testing conversion of a personal
project into git using fast-import.  When fast-import completes
all the files are in the repository but the working tree is empty
and status reports all files are delete but uncommitted.  I have
to use reset --hard HEAD to unwind the pending removal of all of
the files.  Example below.


Is this normal or have I missed something?

Thanks in advance,
Mike


[mike@rockover tmp]$ mkdir test.git
[mike@rockover tmp]$ cd test.git
[mike@rockover test.git]$ git init
Initialized empty Git repository in /tmp/test.git/.git/
[mike@rockover test.git]$ git fast-import << EOF
> # Test git fast-import file
> progress Commit 1/1
> commit refs/heads/master
> mark :1
> committer Fred Bloggs <fred.bloggs@example.com> 1266610576 +0000
> data 16
> Initial checkin
>
> M 644 inline test
> data 10
> Test file
> EOF
progress Commit 1/1
...
[mike@rockover test.git]$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	deleted:    test
#
[mike@rockover test.git]$ ls
[mike@rockover test.git]$ git log | cat
commit 769c8359d963fd13324d522e5e10a0269dd97395
Author: Fred Bloggs <fred.bloggs@example.com>
Date:   Fri Feb 19 20:16:16 2010 +0000

    Initial checkin
[mike@rockover test.git]$ git reset --hard HEAD
HEAD is now at 769c835 Initial checkin
[mike@rockover test.git]$ git status
# On branch master
nothing to commit (working directory clean)
[mike@rockover test.git]$ ls
test
[mike@rockover test.git]$ cat test
Test file

```

## Shawn Pearce, 2010-02-19 23:40

Subject: Re: git fast-import / working tree status question
Message-ID: <ec874dac1002191540p343889d7v5f14876cf0df14c8@mail.gmail.com>
URL: https://gitlist.dev/e/ec874dac1002191540p343889d7v5f14876cf0df14c8%40mail.gmail.com
In-Reply-To: <fc5ef2e01002191520u7b50c98fo3a3defe70e31292a@mail.gmail.com>

```
On Fri, Feb 19, 2010 at 3:20 PM, Mike Fleetwood
<mike.fleetwood@googlemail.com> wrote:
> I am a newbie using git and I am testing conversion of a personal
> project into git using fast-import.  When fast-import completes
> all the files are in the repository but the working tree is empty
> and status reports all files are delete but uncommitted.  I have
> to use reset --hard HEAD to unwind the pending removal of all of
> the files.  Example below.
>
> Is this normal or have I missed something?

Completely normal.  fast-import is a lower level command which only
works on the object directory.  Frontend tools which automate the
conversion are supposed to checkout the working tree files after the
import is complete.  Or, run like you did, `git reset --hard HEAD`.

```
