Wednesday, January 6, 2016

Installing Git on CentOS 6, and Migrating/Converting SVN (Subversion) repositories to GIT

  • GIT Installation step by step -

Git is an open source, distributed version control system (VCS). It’s commonly used for source code 
management (SCM).

Step 1:- Installing git package
# yum update
# yum install git
# git --version

Step 2:- Configuration 
To prevent any commit errors, it’s a good idea to setup your user for git. We’ll setup the user vipin with the
e-mail address
# git config --global "vipin"
# git config --global ""

Step 3:- Verifying the confogiration

To verify the configuration please run the below commands
# cd
# cat .gitconfig
# git config –list

Installation part is completed here. Now we can migrate all SVN repositories to git.

  • Migrating/Converting SVN (Subversion) repositories to GIT -

Before getting there, you need to have availablethe git-svn command. For most distributions, the package 
is also called git-svn. This is a tool that allows you to convert Subversion repositories to Git and also allows 
you to push changes back to the Subversion repository. This could be useful for someone who has to deal 
with a project's Subversion repository but prefers to use Git. For most distributions, the package name is 
called git-svn.

Step 1:- Installing git-svn package

# yum install git-svn

Step 2:- Creating authors.txt file
Now create an authors.txt file. This file will map the names of Subversion committers to Git authors, resulting
in a correct history of the imported Subversion repository.For projects with a small number of committers, this
is quite easy.For larger projects with a lot of committers, this may take some time. The syntax of the file 
would be: user = Xyz Abc <>
# cd
# mkdir git
# cd git
# vi authors.txt
vipin = vipin chereekandy <>

Step 3:- Creating one more git directory 
Now create one more git directory, so that the migrated SVN repos will be available in this directory.

# cd /
# mkdir git

Step 3:- Clone the Subversion repository.
The final step is to clone the Subversion repository, which creates a local Git repository based on it.
# git svn clone --stdlayout --authors-file=authors.txt http://192.168.1.X/testrepo /git/testrepo
                                                               ***** Thanks *****

1 comment:

  1. Well .. Good Info. It really helped.