Howto merge a svn repository with a git cloned repository (imported from SVN via github) -
in past i've have used github's import functionality import svn repository. repository same bare git without connection svn history. commits don't include svn-id
information.
some time has passed , commits added svn repository expected git repository remained same.
so 'update' git repository commits added original svn. i've tried git-svn
couldn't make git recognize common history between cloned svn , cloned git.
i've considered using format-patch
, believe action should solve problem looking more automated way of doing it.
the restriction git history should maintained (no rebase
'ing) , commits faithful svn repository possible (no svn-id
added commit message).
as guessed, getting commits "merge" isn't going work here. have use format-patch
. here how it:
$ git svn clone --no-metadata svn://.../ new-svn-repo $ cd new-svn-repo $ git log
(you may wish add -a
option git svn clone
rewrite svn authorship information user@uuid
format proper joe user <user@example.com>
authorship information. see man git-svn
information.)
look through log , find commit corresponds latest commit in github repository. if commit abcdef
then:
$ git format-patch -k abcdef
you have whole slew of *.patch
files correspond new commits want port over. so...
$ cp *.patch /github/repository/location $ cd /github/repository/location $ git -k --keep-cr *.patch
tada! push master github.
(if git not new enough may complain --keep-cr
argument git am
. if source files not contain crs remove --keep-cr
. if do, may need upgrade git since git mailsplit
, called git am
, strip of crs in patch files out when processing them. may cause patches fail apply.)
Comments
Post a Comment