Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
Last active May 17, 2019 17:50
Show Gist options
  • Save mohanpedala/82843a20bb8cbb28324389acd003384c to your computer and use it in GitHub Desktop.
Save mohanpedala/82843a20bb8cbb28324389acd003384c to your computer and use it in GitHub Desktop.
svn_migration

SVN - GIT Migration

SVN Repo setup

Steps :

  1. Create a new branch in svn repo - phani_branch
svn copy --username swarupdonepudi https://svn.riouxsvn.com/swarup-repo/branches/branch1 https://svn.riouxsvn.com/swarup-repo/branches/phani_branch -m "Creating a branch for final test"
  1. Checkout phani_branch
svn co --username swarupdonepudi https://svn.riouxsvn.com/swarup-repo/branches/phani_branch
  1. Create a new file in phani_branch - file1_for_phani_branch.txt
touch file1_for_phani_branch.txt
  1. Add a line "first line in file for phani_branch" to file1_for_phani_branch.txt
echo "first line in file for phani_branch" > file1_for_phani_branch.txt
  1. Add this new file to remote svn repo
svn add file1_for_phani_branch.txt
  1. Commit this with mesage "First commit for phani_branch"
svn commit -m "First commit for phani_branch"
  1. Create a new file in phani_branch - file2_for_phani_branch.txt
touch file2_for_phani_branch.txt
  1. Add another line "first line in file2 for phani_branch" to file2_for_phani_branch.txt
echo "first line in file2 for phani_branch" > file2_for_phani_branch.txt
  1. Commit this with mesage "Added another file for phani_branch"
svn commit -m "Added another file for phani_branch"
  1. Add another line "first line in file for phani_branch" to file1_for_phani_branch.txt
echo "first line in file for phani_branch" >> file1_for_phani_branch.txt
  1. Commit this with mesage "Added another file1 for phani_branch"
svn commit -m "Added another file1 for phani_branch"

Converting SVN repo to Git and pushing it to Github

On another machine perform conversion preferably linux box

svn2git --username swarupdonepudi https://svn.riouxsvn.com/swarup-repo --trunk branches/phani_branch --nobranches --no-minimize-url --notags
  • Delete any non master branches
git branch -D trunc@2
  • Create a new git repo on github : svn_repo2

https://github.com/swarupdonepudi/svn_repo2.git

  • Add the remote details to the local git repo after converting it from svn
git remote add origin https://github.com/swarupdonepudi/svn_repo2.git

git push --set-upstream origin master

git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment