在Windows CMD的子文件夹中调用git命令时出错

在Windows CMD的子文件夹中调用git命令时出错,windows,git,cmd,Windows,Git,Cmd,我试图在子文件夹中调用git fetch,同时像这样使用Windows CMD D:>C:\Git\cmd\git.exe fetch path\to\subfolder 然后我得到一个错误: 致命:不是git存储库(或任何父目录):.git 但当我在我的存储库文件夹中时,一切正常: D:\path\to\subfolder>C:\Git\cmd\git.exe fetch 我做错了什么?我可以通过CMD调用Windows子文件夹中的git函数吗?我认为git fetch不能用于

我试图在子文件夹中调用
git fetch
,同时像这样使用Windows CMD

D:>C:\Git\cmd\git.exe fetch path\to\subfolder
然后我得到一个错误: 致命:不是git存储库(或任何父目录):.git

但当我在我的存储库文件夹中时,一切正常:

D:\path\to\subfolder>C:\Git\cmd\git.exe fetch

我做错了什么?我可以通过CMD调用Windows子文件夹中的git函数吗?

我认为git fetch不能用于仅获取子目录中更改的文件。git fetch通常用于从远程存储库获取最新的更改,如下所示

git fetch <remote_name> <branch_name>
我希望这能有所帮助。

可能的副本
ajbose@L-BLR-00800896 /c/Code/biz/bizdatacollectnodeweb/test (develop)
$ git fetch unit
fatal: 'unit' does not appear to be a git repository
fatal: Could not read from remote repository.