-
Notifications
You must be signed in to change notification settings - Fork 0
svn2git
holzkohlengrill edited this page Dec 15, 2023
·
2 revisions
#!/bin/bash
# please install git-svn
input_svn="url/to/svn/like/for/checkout"
output_git="url/to/git/like/for/cloning"
svn co "$input_svn" _svn
cd _svn
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
cat authors-transform.txt
if [[ -f "../authors-transform.txt" ]]; then
cp "../authors-transform.txt" .
else
echo "please change authors-transform.txt to authorSVNName = first last <email>"
read
fi
git svn clone "$input_svn" --no-metadata -A authors-transform.txt ../_git
cd ../_git
git remote add origin "$output_git"
git push -u origin master
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License *.
Code (snippets) are licensed under a MIT License *.
* Unless stated otherwise