% mkdir svn2git % cd svn2git % svn checkout https://svn.apache.org/repos/asf/db/jdo
Run the following command that creates the file authors-transform.txt. Then edit authors-transform.txt and add full anme and email on each line.
% svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
The following command will place the git repository in the "~/temp" folder inside your home directory. The command will fail, if there are authors not included in authors-transform.txt. Then you need to extend authors-transform.txt, remove the files being checked out so far and run thecommand again.
% git svn clone https://svn.apache.org/repos/asf/db/jdo --no-metadata -A authors-transform.txt --stdlayout ~/temp
% cd ~/temp % git svn show-ignore > .gitignore % git add .gitignore % git commit -m 'Convert svn:ignore properties to .gitignore.'
Git does not handle empty directories. That means they are removed after the migration from svn to git. If they are imporant for emaple for the build process you should create a file (e.g. README.txt) in the directory.
Create a bare repository
% git init --bare ~/new-bare.git % cd ~/new-bare.git % git symbolic-ref HEAD refs/heads/trunk
Then push the temp repository to the new bare repository.
% cd ~/temp % git remote add bare ~/new-bare.git % git config remote.bare.push 'refs/remotes/*:refs/heads/*' % git push bare % rm -rf ~/temp
% cd ~/new-bare.git % git branch -m trunk master
% cd ~/new-bare.git % git for-each-ref --format='%(refname)' refs/heads/tags | cut -d / -f 4 | while read ref do git tag "$ref" "refs/heads/tags/$ref"; git branch -D "tags/$ref"; done
% git remote rm origin % git remote add origin https://gitbox.apache.org/repos/asf/db-jdo.git % git push --all % git push --tags