Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git status for cloned repository shows file deleted

Tags:

git

I have migrated a cvs repository to git repository and it is in the server. In my local I tried to clone that repository. It got cloned. But when I checked the git status it shows the result as follows for example.

$ cd FMS_RE_ENGG/

$ git status


#   deleted:    FMS_RE_ENGG/Gemfile
#   deleted:    FMS_RE_ENGG/Gemfile.lock
#   deleted:    FMS_RE_ENGG/PACKAGING/CONFIG/fms-frontend.ini
#   deleted:    FMS_RE_ENGG/PACKAGING/DEBIAN/postinst
#   deleted:    FMS_RE_ENGG/PACKAGING/DEBIAN/postrm
#   deleted:    FMS_RE_ENGG/PACKAGING/DEBIAN/preinst
#   deleted:    FMS_RE_ENGG/PACKAGING/DEBIAN/prerm
#   deleted:    FMS_RE_ENGG/PACKAGING/DEBIAN/templates

etc.,

What is the problem? Why I didn't get the source files? If I ran the git checkout FMS_RE_ENGG after cloned it, then I am able to get it. Why it is not giving the source files at the moment of cloning itself?

like image 417
thillaiselvan Avatar asked Apr 28 '12 06:04

thillaiselvan


2 Answers

Just try below command. It worked for me.

git checkout -f HEAD
like image 143
NehaB Avatar answered Oct 22 '22 16:10

NehaB


You have probably used git fast-import to fill your repository with the cvs data. This will modify the data structures inside your .git subdirectories but it will not create a working checkout.

So git status "thinks" that you have deleted ALL your files and that the next commit will remove them from the repository.

Just do git reset --hard to reset your working copy to a clean checkout from your master branch.

like image 26
warywombat Avatar answered Oct 22 '22 18:10

warywombat