克隆存储库的git状态显示文件被删除 [英] git status for cloned repository shows file deleted
问题描述
我已经将一个cvs存储库迁移到了git存储库,并且它位于服务器中。在我的本地,我尝试克隆该存储库。它被克隆了。但是,当我检查git状态时,它显示了如下结果,例如。
$ cd FMS_RE_ENGG /
$ git status
$ b#已删除:FMS_RE_ENGG / Gemfile
#已删除:FMS_RE_ENGG / Gemfile.lock
#已删除: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
#删除:FMS_RE_ENGG / PACKAGING / DEBIAN / prerm
#deleted:FMS_RE_ENGG / PACKAGING / DEBIAN / templates
<等等,
有什么问题?为什么我没有得到源文件?如果我在克隆后运行git checkout FMS_RE_ENGG,那么我就可以得到它。为什么在克隆自己的时候没有提供源文件?
如果我理解正确,我认为你是通过一个基本的克隆命令抓取存储库,如
git clone gitRepositoryLink
运行时:
git checkout FMS_RE_ENGG
这是在您的GIT存储库中检出一个不同的分支。如果您的源文件是FMS_RE_ENGG分支的一部分,但不是主分支,那么当您克隆存储库时,您将看不到源文件,因为您不在FMS_RE_ENGG分支上工作。
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?
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.
这篇关于克隆存储库的git状态显示文件被删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!