[OpenWrt-Devel] SVN to GIT transition

Etienne Champetier champetier.etienne at gmail.com
Mon Oct 12 17:49:56 EDT 2015


Hi All,

Here are some commands to make a "full" git repo, from the "trunk" repo
(the only complaint that everyone agrees on)
We keep git commit sha's for the trunk, and we add all branches/tags

It needs some more tunning, but it's a good start :)

1) clone the trunk repo
git clone git://git.openwrt.org/openwrt.git openwrt-git-svn
cd openwrt-git-svn

2) init git svn
git svn init -T"/trunk" -t"/tags" -b"/branches" --prefix="svn/" svn://
svn.openwrt.org/openwrt

3) tell git that we already have trunk
git update-ref refs/remotes/svn/trunk refs/remotes/origin/master

4) download all branches/tags (except trunk because we already have it)
git svn fetch

resulting .git/config

> [core]
>         repositoryformatversion = 0
>         filemode = true
>         bare = false
>         logallrefupdates = true
> [remote "origin"]
>         url = git://git.openwrt.org/openwrt.git
>         fetch = +refs/heads/*:refs/remotes/origin/*
> [branch "master"]
>         remote = origin
>         merge = refs/heads/master
> [svn-remote "svn"]
>         url = svn://svn.openwrt.org/openwrt
>         fetch = trunk:refs/remotes/svn/trunk
>         branches = branches/*:refs/remotes/svn/*
>         tags = tags/*:refs/remotes/svn/tags/*
>


original SO post: http://stackoverflow.com/a/12251845

Good night
Etienne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20151012/0ce9cc5c/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list