Skip to content

Instantly share code, notes, and snippets.

@markwillis82
Last active December 19, 2015 11:28
Show Gist options
  • Select an option

  • Save markwillis82/5947412 to your computer and use it in GitHub Desktop.

Select an option

Save markwillis82/5947412 to your computer and use it in GitHub Desktop.

Revisions

  1. Mark Willis revised this gist Jul 8, 2013. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions migrateRepo.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    echo "git - svn conversion"
    git svn clone file:///repos/dev.server --authors-file=users.txt --no-metadata -s devGitRepo

    echo "Clean up branches"

    cd bhlive.git/
    git remote add origin <add remote repo url>
    git for-each-ref refs/remotes | cut -d / -f 3- | grep -v @ | while read branchname; do git branch "$branchname" "refs/remotes/$branchname"; git branch -r -d "$branchname"; done

    echo "push to BitBucket"
    git push origin --all
  2. Mark Willis created this gist Jul 8, 2013.
    12 changes: 12 additions & 0 deletions updateUsers.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    echo "Checkout svn repo"
    svn co file:///repos/dev.server dev.repo

    echo "Create users file"
    svn log --xml dev.bhlive.repo | grep -P "^<author" | sort -u | perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt

    echo "Map users to bitbucket accounts"
    cat users.txt

    # chris.cherrett = Chris Cherrett <chris.cherrett@adi.do>
    # thomas.stradling = Thomas Stradling <thomas.stradling@adi.do>