Make bare repository out of git svn init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]