Is there a way to clone a git project with more than one remote repos? For example, in addition to "origin", I would like to have a few other remote repos to push and fetch the data. Is it possible to get all the remote addresses from the git project cloned from?
Asked
Active
Viewed 287 times
0
-
1Isn't that a bit similar to http://stackoverflow.com/questions/849308/pull-push-from-multiple-remote-locations ? – VonC Aug 21 '12 at 20:18
-
1Not remotely, no. It was done on purpose, too. – fork0 Aug 21 '12 at 20:19
-
@fork0: I will be interested to learn what's the purpose? – Patrick Sep 04 '12 at 07:27
-
1@Patrick: consider a public Git repository. This feature would allow an attacker to get a glance at the structure the maintainers of the repo consider private to the repo. And at the time there was not enough pressure for the feature to implement it configurable (with all the decisions to do about the default state). If you have good arguments for it (it will need a protocol extension), you might consider proposing the feature again on the Git mailing list. – fork0 Sep 04 '12 at 09:48
1 Answers
1
For example, in addition to "origin", I would like to have a few other remote repos to push and fetch the data.
Yes, you can have this.
Is it possible to get all the remote addresses from the git project cloned from?
If you have local access to the original repo the following command will work for you.
git remote -v

sjakubowski
- 2,913
- 28
- 36
-
In addition, I'd like to mention that having multiple remote repos is an explicit design goal of `git` (and DVCSes in general) -- you can `git remote add some-name some-url` to add one. See `git help remote` for more details. If you want to see the "remotes of a remote", I'm not aware of a built in way to do that, it's not in line with the type of development workflow git is intended for, as far as I know. – jdd Aug 21 '12 at 21:24
-
Hi, I know how to add remote repositories *after* cloning the project, but what I was looking for is a solution to clone all the remote repositories' address from the parent site. – Patrick Sep 04 '12 at 07:29