git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Make bare repository out of git svn init
@ 2010-03-17 11:45 Sylvain Rabot
  2010-03-17 12:58 ` Miklos Vajna
  0 siblings, 1 reply; 2+ messages in thread
From: Sylvain Rabot @ 2010-03-17 11:45 UTC (permalink / raw)
  To: git

Hi,

Here what I did to make a bare repository out of git svn init.
With this repo I do not intend to push to the svn repo nor to commit
into branches comming from it.
svn trunk will become master and is only fetch, not modified nor
rebased (I did not tried to see if it is working tough).

git svn init svn://<host>/ \
--trunk=<project>/trunk \
--branches=<project>/branches \
--tags=<project>/tags \
project.git

cd project.git
cat .git/config | \
sed s#:refs\/remotes\/trunk#:refs\/heads\/master# | \
sed s#:refs\/remotes\/\\*#:refs\/heads\/*# | \
sed s#:refs\/remotes\/tags\/\\*#:refs\/tags\/*# | \
sed "s#bare = false#bare = true#" > .git/config.tmp
mv .git/config.tmp .git/config
git svn fetch
git svn gc
git gc --aggressive
cp -R .git/* .
rm -rf .git

Then I have a cron which does a git svn fetch on this repo every half an hour.

I am interesting if you see things I forgot to do or some use cases
where those modifications would break anything.

Regards.

-- 
Sylvain

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

* Re: Make bare repository out of git svn init
  2010-03-17 11:45 Make bare repository out of git svn init Sylvain Rabot
@ 2010-03-17 12:58 ` Miklos Vajna
  0 siblings, 0 replies; 2+ messages in thread
From: Miklos Vajna @ 2010-03-17 12:58 UTC (permalink / raw)
  To: Sylvain Rabot; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

On Wed, Mar 17, 2010 at 12:45:49PM +0100, Sylvain Rabot <sylvain@abstraction.fr> wrote:
> I am interesting if you see things I forgot to do or some use cases
> where those modifications would break anything.

This is what girocco does:

http://repo.or.cz/w/girocco.git/blob/HEAD:/taskd/clone.sh#l25

So it's not necessary to use a tmp non-bare repo as an intermediate
step.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

end of thread, other threads:[~2010-03-17 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-17 11:45 Make bare repository out of git svn init Sylvain Rabot
2010-03-17 12:58 ` Miklos Vajna

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).