Welcome little one.

As I await in the lobby for news from your father about your arrival I just want to to say — Welcome to the team. It is not a big team but we’re also not that small either. You are the fifth to join…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Step by step guide to migrate project from svn to git repository

Git is the new source control tool which is now widely used across because of the flexibilty it offers. You might land up in a situation where in you want to migrate your project from svn to git repository. This article will help you achieve it. I have used a linux server here for the migration. Lets get started.

Step 1 : Install the prerequisites and utilities required for migration using the below mentioned command.

In case if you are using an aws linux server the above commands will not work. Please use the below mentioned commands.

Step 2: Extract the list of authors who have made commits to different projects in the svn repository. This is required to import the project from svn, with complete commit history to git repository.

svn log — username <username> — password <password> — quiet http://xxx.xx.xx.xxx/svn | grep -E “r[0–9]+ \| .+ \|” | cut -d’|’ -f2 | sed ‘s/ //g’ | sort | uniq >> authors.txt

Step 3: Fetch the revision number of a given project from svn repository. This is the point from where you import will be done. You will get a revision of all the updates made to the project. Choose the least number out of it, this is to fetch all the previous commits of the project.

Step 4 : Run the svn2git command for a given project which you want to import from svn to git reposotory. To run this command authors.txt and revision number is required which is fetch from previous steps.

Step 5 : Post this a local git repository will be created.Code present in trunk for the specific project will be pushed to master branch long with tags and other branches. Check it using below mentioned command.

Step 6 : Check the project structure and make required changes. You can check the list of files which will be pushed to remote git repository, before commit using below command.

git ls-files

use git add command to add new files, git mv to move and git rm to remove files, in case of any. Use these comand to add/remove/move files in your project before commit.

Step 7 : Configure the remote git repository where you want to commit your project.

Step 8: Prepare the commit along with an appropriate message.

git commit –m “message”

Step 9 : Push your project to the remote git repositoty using the below command. If there is already some content available in the remote git repository and you want to override it you can do so, by adding -u — force option to the below command. This will perform force commmit and override existing code. Specify the master along with exactacted tag and branch names. All will be pushed to remote git repository.

The above command which prompt you to enter your git credentials.

Thats it your project is committed now to the git repository. It is always recommended to commit your code in private git repository in case if it has sensitive information like passsword/keys.

Add a comment

Related posts:

WHY DOES MY MOTHER ALWAYS FORCE ME TO WAKE UP EARLY?

It is Friday night and as usual I turn off the machine of the old motorcycle in front of the door at 11.00 p.m to avoid waking everybody up from their deep slumber. The joy of the meeting with my…

The Purple Crayon

It is startling how often authority figures, our school system, adults, and society in general try to squash or thwart our creativity from an incredibly young age. These people and systems do their…

The Optimum Hemochromatosis Diet Cookbook

Complete Beginners Nutritional Guide with Easy-to-Follow Recipes for Reducing the Absorption of Iron and Managing Symptoms with 30-Day Meal Plan Hemochromatosis is a genetic disorder characterized by…