Syncing GExperts svn to git
Posted by jpluimers on 2020/07/23
A while ago, I made a synced git repository and put it on [WayBack] GitHub – jpluimers/GExperts: Synced every now and then from git svn clone https://svn.code.sf.net/p/gexperts/code/trunk GExperts.
I forgot to save my initial notes, but they were based on what I did before with [WayBack] jeroenp / fastmm — Bitbucket**, so I resurrected my notes, after a chat with Graeme Geldenhuys on how he did a similar thing for Indy at
[WayBack] GitHub – graemeg/indy: Indy (Internet Direct) framework. This is an unofficial mirror repository which gets synced every 15 minutes. It contains the full history from the official Indy 10 SVN repository.
So here are my notes, as on GitHub they look odd:
[WayBack] GitHub – jpluimers/GExperts
Synced every now and then from git svn clone https://svn.code.sf.net/p/gexperts/code/trunk;
Syncing steps:
first time
git svn clone https://svn.code.sf.net/p/gexperts/code/trunk GExperts.git-svn
git remote add origin https://github.com/jpluimers/GExperts.git
git push origin master
each additional time from inside the
GExperts.git-svn
directory:
git svn fetch
git svn rebase
git push origin
It is very similar to what Graeme does for Indy in a cron job for each subsequent sync from https://svn.atozed.com:444/!/#Indy10/view/head/trunk/Lib to https://github.com/graemeg/indy:
#!/bin/sh # Fetches latest revisions for Indy SubVersion repository # and then pushes changes to GitHub. # Created by Graeme Geldenhuys GIT="/usr/bin/git" cd /data/git/indy.git/ $GIT checkout master $GIT svn rebase $GIT gc --auto $GIT push github
And to my FastMM notes:
Getting the latest SVN changes:
git svn rebaseInitial repository creation and add to bitbucket (or github)
git svn clone http://svn.code.sf.net/p/fastmm/code/ FastMM.gitNotes (see [WayBack] Effectively Using Git With Subversion | Viget and [WayBack] Practical tips for using Git with large Subversion repositories for explanation):
- Do not include the
-s
option aftergit svn clone
, as this SVN repository does not have the defaulttrunk
/branches
/tags
structure.- There are no [WayBack] SVN ignore entries in this repository, so this is not needed for
git svn show-ignore > .gitignore
Add the repository to Bitbucket or GitHub:
- [WayBack] TheRealTimeWeb.com: Move An Existing Git Repository Into Bitbucket In 3 Steps
- [WayBack] Adding an existing project to GitHub using the command line – User Documentation
Add either of these URLs to [WayBack] Feedly for monitoring:
Some additional tidbits:
- [WayBack] Keep svn repository in sync with git one – Stack Overflow
- [WayBack] Use Git even if your team doesn’t: git-svn tips and tricks
- [WayBack] How do I keep an svn:external up to date using git-svn? – Stack Overflow
–jeroen
Leave a Reply