Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
git更改了存储库的位置。如何恢复或修复到原来的位置_Git_Github - Fatal编程技术网

git更改了存储库的位置。如何恢复或修复到原来的位置

git更改了存储库的位置。如何恢复或修复到原来的位置,git,github,Git,Github,我无意中尝试使用functions文件夹中的git add-A,这是该存储库的新功能。现在,我不能从任何地方推,而不得到这个错误 Peters-MacBook-Pro-5:pk2-angular-v1.0.0 apple$ git push -u origin master Counting objects: 42186, done. Delta compression using up to 4 threads. Compressing objects: 100% (40253/40253),

我无意中尝试使用functions文件夹中的git add-A,这是该存储库的新功能。现在,我不能从任何地方推,而不得到这个错误

Peters-MacBook-Pro-5:pk2-angular-v1.0.0 apple$ git push -u origin master
Counting objects: 42186, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (40253/40253), done.
Writing objects: 100% (42186/42186), 147.16 MiB | 3.66 MiB/s, done.
Total 42186 (delta 13516), reused 0 (delta 0)
remote: Resolving deltas: 100% (13516/13516), done.
To https://github.com/pgwest/subscriptionQAFinal.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

Peters-MacBook-Pro-5:pk2-angular-v1.0.0 apple$ git add -A
fatal: Not a git repository: functions/node_modules/grpc/deps/grpc/third_party/zlib/../../../../../../.git/modules/packages/grpc-native-core/deps/grpc/modules/third_party/zlib
我试着检查git配置文件,它看起来是正确的。为什么git要在functions/node_modules/中寻找存储库。。。我该如何解决这个问题?我还试着点击git init。这没用

您可以:

  • 删除过时的子模块信息(as)
  • 使用git submodule add重新声明子模块(使用回购的正确路径)
  • 再次添加、提交和推送

我被你的描述搞糊涂了。你说,
gitpush
给了你一个错误,但在我看来,
gitpush
是完全成功的。然后你做了一个git-add-a,但没有成功。哪个东西对您不起作用?git add不起作用,路径解析为
函数/.git/modules/packages/grpc native core/deps/grpc/modules/third_party/zlib
——这说明了什么吗?它与您的子模块设置有关吗?