Re: Move to salsa.debian.org
> Did you find anywhere an svn -> git migration guide, which works? I need to
I can do it for you. I attach my notes from back back back then, they
are targetted at alioth, but you could immediately do this on salsa or
a local machine before pushing to salsa.
Norbert
--
PREINING Norbert http://www.preining.info
Accelia Inc. + JAIST + TeX Live + Debian Developer
GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
for ${package}, but replace with any other:
See http://john.albin.net/git/convert-subversion-to-git
and http://john.albin.net/git/git-svn-migrate
export package=tex-gyre
########################
# FOLLOWING ON git.debian.org !!!!!!!!!!!!!!
# either do:
# cd /git/debian-tex/
# umask 002
# setup-repository ${package} "description"
# ${package}.git
# git symbolic-ref HEAD refs/heads/trunk
# cd ..
# or
cd /git/debian-tex/
umask 002
mkdir ${package}.git
cd ${package}.git
git --bare init --shared
git symbolic-ref HEAD refs/heads/trunk
echo "Debian packaging of ${package})" > description
mv hooks/post-update.sample hooks/post-update
chmod a+x hooks/post-update
git config --add hooks.mailinglist "debian-tex-maint@lists.debian.org"
cat >hooks/post-receive <<END
#!/bin/sh
exec /usr/local/bin/git-commit-notice
END
chmod a+x hooks/post-receive
########## END OF WORK on git.debian.org
git svn clone svn://svn.debian.org/svn/debian-tex --no-metadata -A ../svn-git-authors-transform.txt --trunk=${package}/trunk --tags=${package}/tags --branches=${package}/branches ./temp.${package}
#
# if there are svn ignore stuff:
# cd temp
# git svn show-ignore > .gitignore
# git add .gitignore
# git commit -m 'Convert svn:ignore properties to .gitignore.'
# cd ..
cd temp.${package}
git remote add bare git+ssh://preining@git.debian.org/git/debian-tex/${package}.git
git config remote.bare.push 'refs/remotes/*:refs/heads/*'
git push bare
cd ..
#
# remove original import
#
rm -rf temp.${package}
######## ON git.debian.org
cd ${package}.git
git branch -m trunk master
#
# convert tags
# decide on which names you want!
#
# MAYBE FIRST RENAME ANY OLD TAGS!!!!!! as branches
# one does not need old tags for long lost released. Only those in
# stable, testing, sid and afterwards???
git for-each-ref --format='%(refname)' refs/heads/tags | cut -d / -f 4 | \
while read ref ; do
# for a bit different name
# git tag "debian/$ref" "refs/heads/tags/$ref"
git tag "debian/$ref" "refs/heads/tags/$ref"
git branch -D "tags/$ref"
done
########## END ON git.debian.org
# make final working checkout
git clone git+ssh://preining@git.debian.org/git/debian-tex/${package}.git
# set up local user name if it is not set up globally or
# you want a different one
cd ${package}
git config user.email "preining@debian.org"
git config user.name "Norbert Preining"
#
#if you want to get all branches:
# for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
# git branch --track ${branch##*/} $branch
# done
######################################################
# set up for git-buildpackage and import of upstream source
# from file:///usr/share/doc/git-buildpackage/manual-html/gbp.import.html
# there is an eplanation about "mergeWithUsptream"
# make sure that all previous upstream branches are dleted
git branch -D upstream
git push origin :upstream
# start a new empty branch, needs at least 1.7.2.3 of git
git checkout --orphan upstream
git rm -rf .
git commit --allow-empty -m 'Initial upstream branch.'
git checkout master
# run the import routines
git-import-orig --no-sign-tags ....../${package}_NNNNNN.tar.gz
Reply to: