如何添加本地回购并将其视为远程回购 [英] How to add a local repo and treat it as a remote repo
问题描述
我试图用我的电脑上的另一个本地存储库作为远程名称为 bak
的本地存储库,使用以下命令:
git remote add /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git bak
$ c
给出这个错误:
致命:'/home/sas/dev/apps/smx/repo/bak/ontologybackend/.git'不是有效的远程名称
我试图同步两个本地回购站,其中一个配置为另一个名为 bak
的远程设备,然后发行 git pull bak
。
最好的办法是什么?
< hr>
编辑:
对不起,应该是:
git remote add bak /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git
遥控器的名称在地址前。
解决方案您已将您的参数转换为 remote add
命令:
git remote add< NAME> < PATH>
所以:
git remote add bak /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git
有关更多信息,请参阅 git remote --help
。
I'm trying to make a local repo act as a remote with the name bak
for another local repo on my PC, using the following:
git remote add /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git bak
which gives this error:
fatal: '/home/sas/dev/apps/smx/repo/bak/ontologybackend/.git' is not a valid remote name
I'm trying to sync two local repos, with one configured as a remote named bak
for the other, and then issuing git pull bak
.
What is the best way to do it?
Edit:
Sorry, silly me, I've just realized the remote add should be:
git remote add bak /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git
the name of the remote goes before the address.
解决方案 You have your arguments to the remote add
command reversed:
git remote add <NAME> <PATH>
So:
git remote add bak /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git
See git remote --help
for more information.
这篇关于如何添加本地回购并将其视为远程回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!