Skip to content

Instantly share code, notes, and snippets.

@ik0r
Created January 4, 2014 03:35
Show Gist options
  • Select an option

  • Save ik0r/8251291 to your computer and use it in GitHub Desktop.

Select an option

Save ik0r/8251291 to your computer and use it in GitHub Desktop.
放在svn目录中,执行 ./svn2git.sh > author.txt 或者 ./svn2git2.sh > author.txt 得到所有提交者的信息,然后修改author.txt中等号后面的信息 在使用git-svn迁移项目时,使用 --authors-file=author.txt导入提交者信息
#!/usr/bin/env bash
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = ${author} email@example.com";
done
#!/usr/bin/env bash
svn log --xml | grep -P "^<author" | sort -u | perl -pe 's/<author>(.*?)<\/author>/$1 = $1 email@example.com/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment