Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
1 view
in DevOps and Agile by (29.3k points)

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?

1 Answer

0 votes
by (50.2k points)

The syntax for remote add is:

git remote add <NAME> <PATH>

This is the way to add the local repo and treat it as a remote repo and according to your question all you need to do is:

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

For more information, you could refer: https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emaddem 

Browse Categories

...