gpt4 book ai didi

Git Clone Repo 没有 .git 文件

转载 作者:太空狗 更新时间:2023-10-29 13:59:54 25 4
gpt4 key购买 nike

我用 git clone <path to repo> 克隆了一个 repo但是当我运行 git status我得到 fatal: not a git repository错误。

我想知道的是,如果我运行 git init在克隆的本地目录中,它会搞砸任何事情或导致 GitHub 上的初始存储库出现问题吗?

cd && ls -a进入几个目录,但我没有看到 .git文件。

所以我首先用 $ git ls-files | grep .git 进行了搜索并得到相同的fatal no repo错误。

然后我用 $ find . | grep .git 进行了搜索它列出了 3 .gitignore文件。我认为这意味着最初的创建者没有初始化 git。

我想创建一个分支并开始工作并进行提交,而不会弄乱原始存储库。

我引用了以下 StackOverflow 问题,但它们没有给我所需的答案:

"fatal: Not a git repository (or any of the parent directories)" from git status

fatal: Not a git repository (or any of the parent directories): .git

最佳答案

您的存储库似乎已损坏。确保您没有在克隆后错误地删除 .git 文件夹。也许,只需再次克隆并从那个新克隆开始工作。

关于Git Clone Repo 没有 .git 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30510849/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com