我刚刚回到一个我已经使用 Git 大约 6 个月的项目,看到了这个:
$ cd /d/DEVELOP/BlenderAe # My repo root
$ git status
fatal: not a git repository (or any of the parent directories): .git
Run Code Online (Sandbox Code Playgroud)
这绝对是正确的路径,为什么 git 无法识别我的本地克隆?
我最后的行动是:
git文件夹内容如下:
$ cd /d/DEVELOP/BlenderAe # My repo root
$ ls .git
ORIG_HEAD objects/ refs/
Run Code Online (Sandbox Code Playgroud)
我确实有当前的代码(在 git 之外对其进行了备份)。我该如何重新连接?还有我的 github 远程吗?
修复后ORIG_HEAD我看到:
$ git status
Not currently on any branch.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: (old_file1).py
...all …Run Code Online (Sandbox Code Playgroud)