git clone - How to get all remotes urls from remote git repo? -


For example, we have a git repository A, which has two remote:

  User @ user: ~ / dev / tmp / some_repo $ git remote -v remote_a / home / user / dev / tmp / a / (fetch) remote_a / home / user / dev / tmp / a / (push) remote_b / home / User / dev / tmp / b / (fetch) remote_b / home / user / dev / tmp / b / (push)  

I want to clone this repository and have the same remote I want to receive, but only the original:

  user @ user: ~ / dev / tmp $ git clone some_repo / some_clone clips in 'some_clone' Doing ... done User @ user: ~ / dev / tmp $ cd some_clone / user @ user: ~ / dev / tmp / some_clone $ git remote -v root / home / user / dev / tmp / some_repo / (fetch) original / home / user / Dev / tmp / some_repo / (push)  

Is there any way to get all the remotes from the original, so remote_a and remote_b some_clone were also remotes for one?

Protocols are available for GIT (for cloning, fetching updates, etc.) Therefore, there is no answer in the same sense: there is no way to do this.

For your special example, however, the stores you are cloning already have locally, you have clear access to it clearly. All you have to do is finish it and Use git config (or similar) to remove all the required information, then copy it to the new clone.

Applies to any repository cloning from "Remote" from a single place: To get the configuration information you need it to (such as the ability of ssh-log-in on the host machine) Any other type of access is required.


Comments