是否有 Git 等效的 Hg 方案?

Is there a Git equivalent of Hg schemes?

Mercurial (Hg) 有一个名为 schemes 的扩展,这在您使用托管所有存储库的服务器并且希望将它们指向不同的服务器或本地目录时非常有用你离线了。

Git 有对应的吗?

我对与 Git 子模块一起使用感兴趣。理想情况下,我想将所有存储库缓存在我的磁盘上,并将另一台机器的新鲜克隆指向我的本地存储库。

您只需将新的遥控器添加到您的存储库即可。
git remote add <new_remote_name> <path_or_url>

由于您的分支通常设置为跟踪来源,因此您需要手动指定要 pull/push 来自的分支:
git pull <new_remote_name> <remote_branch>
git push <new_remote_name> <local_branch>:<remote_branch>

如果你想让东西更永久,你可以替换原点的url/path:
git remote set-url origin <path_or_url>

或更改您的本地分支正在跟踪的远程分支:
git branch -u <new_remote_name>/<remote_branch> <local_branch>

Check this answer for more details on how to push and pull to from multiple remotes simultaneously.
git remote set-url origin --add <path_or_url>
git remote set-url origin --add <another_path_or_url>