使用git命令新增文件,报错:

[email protected] MINGW64 /d(master) $ git add aaa.txt                           
fatal: not a git repository (or any of the parent directories): .git                            

原因: 本地git 与 github之间的通信断开

测试连接

[email protected] MINGW64 /d(master) $ ssh -T [email protected]

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

解决办法:

将本地 id_rsa.pub(公钥)的内容,添加到 GitHub  SSH keys

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

配置好之后,重新测试连接

[email protected] MINGW64 /d(master) $ ssh -T [email protected]

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

重新切换到master分支下,重新添加文件即可。

相关文章:

  • 2022-12-23
  • 2021-08-07
  • 2021-06-03
  • 2021-08-14
  • 2021-09-30
  • 2022-12-23
  • 2021-05-19
猜你喜欢
  • 2022-01-12
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案