git status for cloned repository shows file deleted

前端 未结 4 1756
无人及你
无人及你 2020-12-16 18:42

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

相关标签:
4条回答
  • 2020-12-16 19:07

    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.

    0 讨论(0)
  • 2020-12-16 19:10

    What does git branch -a show you after cloning is complete? The problem might be in that git clone asks the remote which branch it has as its current branch and reflects this in the cloned (your local) repo.

    Supposedly either your conversion tool screwed something or the remote repo is somehow screwed with respect to its idea about its active branch.

    We need more information from you to make better guesses.

    0 讨论(0)
  • 2020-12-16 19:17

    If I understand you correctly, I assume you are grabbing the repository via a basic clone command like

    git clone gitRepositoryLink
    

    When you run:

    git checkout FMS_RE_ENGG
    

    this is checking out a different branch within your GIT repository. If your source files are part of the FMS_RE_ENGG branch but not the master branch, when you clone the repository you will not see your source files, because you are not working on the FMS_RE_ENGG branch.

    0 讨论(0)
  • 2020-12-16 19:22

    Just try below command. It worked for me.

    git checkout -f HEAD
    
    0 讨论(0)
提交回复
热议问题