[bt-devel] git help

Greg Hellings greg.hellings at gmail.com
Thu Aug 5 16:48:12 MST 2010


OK, I seem to have figured it out. I followed the directions at
https://git.wiki.kernel.org/index.php/GitFaq#svn-mirror but modified
them to suit our own purposes

Initialize bare repo:
$ cd /home/sites/thehellings.com/bibletime
$ mkdir bibletime.git
$ cd bibletime.git
$ git init --bare
$ git symbolic-ref HEAD refs/heads/trunk

Pull BibleTime
$ cd ~/
$ git svn clone https://bibletime.svn.sf.net/svnroot/bibletime
--ignore-paths="^trunk/(bibletime2|sandbox|website|website-2.0)"
(the above command took between 50 and 70 minutes, depending on
latency - not bandwidth)
$ git remote add bare /home/sites/thehellings.com/bibletime/bibletime.git
$ git config --unset remote.bare.fetch
$ git config remote.bare.push "refs/remotes/*:refs/heads/*"
Convert git branches that were originally SVN tags back into git tags
$ git branch -r | grep tags | sed -e 's/.*\///' | xargs -I % git tag
-a -m\"%\" % tags/%
Remove the fake tag/branches from the following
$ git branch -r | grep tags | sed -e 's/.*\///' | xargs -I % git
branch -r -d tags/%
Push to public repository
$ git push bare
$ cd /home/sites/thehellings.com/bibletime/bibletime.git
$ git update-server-info
(Not totally sure why this last one was necessary, but when I tried to
clone it to my workstation it failed and told me to run that command.
After running it, I could pull without an issue).

Lots of thanks to the people in #git for pointing me in the right
direction for that.  We still have the extraneous bibletime/ directory
in the git repository, but one could easily do a git mv to move the
files out of that directory if you wanted to.  Anyway, if you need to
pull, you can grab it with
$ git clone http://bibletime.thehellings.com/bibletime.git
It should clone in about 30 seconds instead of the hour that it takes
to pull the full SVN.  I can't tell if it's pulling the tags from the
repository or not.  They aren't listing with "git tag" from my clone
even though they're listed in the original push directory, but I'm not
sure if they should or not.  Any hints on that one?

--Greg

On Thu, Aug 5, 2010 at 8:48 AM, Martin Gruner <mg.pub at gmx.net> wrote:
> Hi Jaak,
>
> today I tried to clone the "bibletime" part of our sf SVN repository
> into a git repository with
>
> git svn clone -s https://bibletime.svn.sourceforge.net/svnroot/bibletime
> bibletime
>
> unfortunately this will import all modules, also bibletime2, website and
> so on. What I want is a repository with only "bibletime", but for that
> the full history, tags and branches. Is that possible? If that requires
> reorganization of the SVN repository (don't know if that's technically
> possible), we can do so.
>
> mg
>
> _______________________________________________
> bt-devel mailing list
> bt-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/bt-devel
>



More information about the bt-devel mailing list