I have a lot of pre-existing projects and code in a few different Subversion repositories. I am planning on getting my toes wet with Git by migrating a few of the easier/soon to be multi-developer projects to Git. I have a few questions:
If I start with a hosted Git solution, is it hard to change the Git server of a project (In Subversion, you simply have to change the URL, etc)? I would do this to get up and running and comfortable with Git before installing and maintaining my own server locally.
What are some good steps to follow to migrate my data from Subversion to Git? Will I have to check out every revision from SVN, export, and commit to Git to get the history?
Any gotchas that you've experienced?
A few reasons for the change: We do a LOT of branching and merging, we will be adding a few developers on these projects, we will have developers not always in the office/on the network/etc.
1. it is actually very easy to change the server since you clone the entire repository on your computer then you just push it to the new server;
2. you can use git-svn to clone the svn repository in a new git repository preserving the history. First you need to create a users file that maps all your SVN users to your GIT users. Make a file on your Desktop named ‘users.txt’. Map the users using this format:
username = Full Name <[email protected]>
Now run these commands:
git-svn init url.to.svn.repository --no-metadata
git config svn.authorsfile ~/Desktop/users.txt
git-svn fetch
The first command initializes the directory as a git-svn hybrid and points the origin at your svn repository. The flag, --no-metadata, tells git to leave all the svn details behind (not the commit log). The next command tells git to remap all the svn users to git users. The last command actually does the fetching.
firstly I would recommend book Pro Git
It's not difficult at all. You can do something like
git remote add
and you can have more remotes at the same time and fetch changes from your coworkers to different branches before you merge them and push to the server.
I have no experiences with more branches in svn but for me was enough to do something like
git svn clone svn-repo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With