git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylvain Rabot <sylvain@abstraction.fr>
To: git <git@vger.kernel.org>
Subject: Make bare repository out of git svn init
Date: Wed, 17 Mar 2010 12:45:49 +0100	[thread overview]
Message-ID: <7fce93be1003170445x4a9d240cv2ca37737d6c7a244@mail.gmail.com> (raw)

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

             reply	other threads:[~2010-03-17 11:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 11:45 Sylvain Rabot [this message]
2010-03-17 12:58 ` Make bare repository out of git svn init Miklos Vajna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7fce93be1003170445x4a9d240cv2ca37737d6c7a244@mail.gmail.com \
    --to=sylvain@abstraction.fr \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).