Archive for March, 2014

Assuming you have the svn and an empty GIT repository, first you need to check out the git repo:

git svn clone

you’ll have the folder named ‘svnpath’ checked out and converted to git format.

The you need to change the author names, we’ll use a feature called ‘filter-branch’ in git to change author names and email addresses:


hput() {
  eval "$1""$2"='$3'

hget() {
    eval echo '${'"$1$2"'#hash}'

# The original SVN usernames
hput originals x1 "Nadalizadeh"
hput originals x2 "sina.bahar"
hput originals x3 "faraz.shamshirdar"
hput originals x4 "elrusho"

# The new GIT Names
hput names x1 "Ali Nadalizadeh"
hput names x2 "Sina Baharlouie"
hput names x3 "Faraz Shamshirdar"
hput names x4 "Soroush Khodaii"

# The new GIT Email Addresses
hput emails x1 ""
hput emails x2 ""
hput emails x3 ""
hput emails x4 ""

for h in ${!names*}; do
    export oldname=`hget originals $key`;
    export newname=`hget names $key`;
    export newemail=`hget emails $key`;

    echo "Changing $oldname to $newname <$newemail>"
git filter-branch -f --commit-filter '
        if [ "$GIT_AUTHOR_NAME" = "$oldname" ];
                git commit-tree "$@";
                git commit-tree "$@";
        fi' HEAD


Run the above script inside root of your git repository and ofcourse you need to change the names and emails your own values you get from “svn log” and “git log”

Finally push your new git repository to your remote address:

git remote add origin
git push -u origin master

Faced a problem while downloading JDK from the shell?
Yes, Oracle checks for cookies and here’s a small trick to install latest JDK right from oracle’s website:

wget --no-check-certificate --no-cookies --header "Cookie:" -O jdk-linux-x64.rpm ""

rpm -Uvh jdk-linux-x64.rpm