Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I clone a repository with all remotely tracked branches?

0
Posted

How do I clone a repository with all remotely tracked branches?

0

Suppose you have a repository configured with several remotes: origin (the default), foreign1, foreign2. You want to do a clone but do not want to set up all foreigns again and still be able to checkout any branch from foreign1 or foreign2 (you have origin for free). There’s a git-clone option –mirror which sets up all remotely tracked branches. So far this is a fundamental knowledge obtained from frequent documentation readings *cough*. But, –mirror also implies –bare option, ie. the clone will will not be created as a working copy and you cannot checkout the branches.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123