How to Migrate Project from SVN to GIT?

Connect with

Learn how to migrate project from SVN to GIT with Step by step migration process. This is very simple by following the below steps.

Step #1: create the authors file

 svn log -q SVN_URL | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" "}' | sort -u > authors.txt

Step #2: convert your SVN project into Git

convert your SVN project into Git by executing below command

 git svn clone -r1:HEAD --no-minimize-url --stdlayout --no-metadata --authors-file authors.txt SVN_URL

Step #3: Go inside created project directory

cd createdProject

Step #4: Add remote GIT_URL as origin

Add remote GIT_URL as origin run below command

 git remote add origin GIT_URL

Step #5: push branches

For pushing branches use below commands

 git checkout -b BRANCH_NAME origin/BRANCH_NAME

Step #6: Push tags

For pushing tags use below commands

 git checkout origin/tags/TAG_NAME
 git tag -a TAG_NAME -m "creating tag"

Step #7: Pushing Git Master Branches to Remote

 git push origin --all

Step #8: Pushing Git tags to Remote

git push origin --tags

Visit GIT Repository for more details.
Your suggestions are welcome to encourage me to write and improve this post.


Connect with

Leave a Comment

Your email address will not be published. Required fields are marked *