Wednesday, April 24, 2013

How to migrate from SVN to GIT

Currently, Git is getting popularity as a distributed version control system. Many Subversion repository is moving from SVN to Git. I have recently moved a SVN repository under GIT version control system.

Git has come up with built in support for svn switching. We will us the git svn command in this regard. First we will get the codebase from SVN with the below command
git svn clone http://path_to_repository folder_name

With the below command you will see all the log history are also carried to the Git repository

git log

To remove svn tags to be more proper tags on git:
git for-each-ref refs/remotes/tags | cut -d / -f 4- | grep -v @ | while read tagname; do git tag "$tagname" "tags/$tagname"; git branch -r -d "tags/$tagname"; done

Next, we will move the remaining references to /remote/references
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

Now, we will add the origin to the Git URL
git remote add origin https://path_to_git_repo

Finally, you need to push your changes to the remote repository:
git push origin --all

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide

List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

No comments: