git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Manually turning a --bare local repository to a real mirror repository (--bare --mirror)
@ 2011-01-18 21:59 Ilyes Gouta
  2011-01-18 22:35 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Ilyes Gouta @ 2011-01-18 21:59 UTC (permalink / raw)
  To: git

Hi,

I'm setting up a local git repo which should mirrors the branches of
the original repo and at the same time hosts the local private
developement branches of the team.

At first step I did create a local copy by issuing:

git clone --bare <original_git_repository>

I found out later that fetching the various refs lead the local master
ref not automatically following the remote/master ref, after every git
fetch --all. I found that I have to use:

git clone --bare --mirror <original_git_repository>

instead to get that effect. Now please keep in mind that I intend to
also create local private branches where developers will push their
custom code.

My question: given that I don't have enough bandwidth and constant
Internet connectivity, I'd like to ask if it's possible to manually
turn a pure --bare local repository into a --bare --mirror one? If
yes, how to do that?

Please CC me when replying, because I'm not registered to the mailing list.

Thanks,

-Ilyes

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Manually turning a --bare local repository to a real mirror repository (--bare --mirror)
  2011-01-18 21:59 Manually turning a --bare local repository to a real mirror repository (--bare --mirror) Ilyes Gouta
@ 2011-01-18 22:35 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2011-01-18 22:35 UTC (permalink / raw)
  To: Ilyes Gouta; +Cc: git

> My question: given that I don't have enough bandwidth and constant
> Internet connectivity, I'd like to ask if it's possible to manually
> turn a pure --bare local repository into a --bare --mirror one? If
> yes, how to do that?

An ordinary bare clone has no fetch configuration.  To turn the repo
into a mirror you just have to add one:

$ git config remote.origin.fetch "+refs/*:refs/*"

and set the mirror flag:

$ git config remote.origin.mirror true

Then do a git fetch to fetch any missing refs.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-18 22:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-18 21:59 Manually turning a --bare local repository to a real mirror repository (--bare --mirror) Ilyes Gouta
2011-01-18 22:35 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).