我刚刚重回一个我已经使用 Git 管理大约 6 个月的项目,看到了这个:
$ cd /d/DEVELOP/BlenderAe # My repo root
$ git status
fatal: not a git repository (or any of the parent directories): .git
这绝对是正确的路径,为什么git无法识别我的本地克隆?
我最后的操作是:
- 创建本地分支
- 在本地分支上工作(是否切换到本地分支导致了问题?)……
- 保存但未推送到远程(我再也不会错过这一步了!噢呜!)。
git文件夹的内容如下:
$ cd /d/DEVELOP/BlenderAe # My repo root
$ ls .git
ORIG_HEAD objects/ refs/
我有当前的代码(已经备份,不在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 the older files that were previously renamed/deleted are listed here for deletion.
Untracked files:
(use "git add <file>..." to include in what will be committed)
Current_file1.py
...all the current files are listed here as untracked.
pwd
和git status
的输出(包括shell提示符),以及资源管理器中文件夹的截图? - Joachim Sauer/d/DEVELOP/BlenderAe
git status -...MINGW64 /d/DEVELOP/BlenderAe $ git status fatal: not a git repository (or any of the parent directories): .git
pwd -/d/DEVELOP/BlenderAe
git status -...MINGW64 /d/DEVELOP/BlenderAe $ git status 致命错误:不是一个 git 仓库(或任何父目录):.git
- Danls .git; git status
。请不要通过评论回答信息请求。 - AD7six