git远程库与本地联系报错fatal: Not a git repository (or any of the parent directories): .git

在github上新建了一个仓库,然后相与本地的仓库联系起来

$ git remote add origin https://github.com/liona329/learngit.git

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

总是报这个错

解决方法:git init

成功

原文地址:https://www.cnblogs.com/xinxin1994/p/8484725.html