opensas opensas - 1 month ago 6x
Git Question

git how to add a local repo and treat it as a remote one

I'm trying with

git remote add /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git bak
fatal: '/home/sas/dev/apps/smx/repo/bak/ontologybackend/.git' is not a valid remote name

I'm trying to sync two local repos, I was thinkg aboug configuring as a remote, and then issuiing git pull bak

what would be the best way to do it?


sorry, silly me, I've just realized the remote add should be like this

git remote add bak /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git

the name of the remote before the address


You have your arguments to the remote add command reversed:

git remote add <NAME> <PATH>


git remote add bak /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git

See git remote --help for more information.