Friday, April 19, 2013

My first taste of GIT

Posted by Xun at 7:41 PM
GIT is a wonderful thing, but my first taste of GIT, more specifically, my process of migrating from SVN to GIT is wrought with failures and cryptic error messages. And I suspect I was not alone. For up to this point, there are 26,229 questions tagged with GIT. Considering what a young thing GIT is, this speaks for both of its popularity and "hardness".




To migrate my project from SVN to GIT, other than the instructions given by my colleagues, I also consulted the following links and chewed on the many help tips turned up from Google (honestly most of them are left undigested).

Converting a Subversion repository to Git
GIT ---everything-is-local
Converting from Subversion to Git

So all of the wonderful links have listed the steps and commands. I just want to retell my trials and errors. Actually just errors.

First Trial: Migrating the whole SVN (history, branches and tags) to GIT. Failed Completely!

Error 1
Found possible branch point
Solution: .Go to git/config file and delete all the branches and tags entries under the svn-remote section

Error 2:
RA layer request failed
By StackOverFlow, this is because some revision get messed up, so need to go to the next GOOD revision and continue from there.

However since this happens at an ever more frequent rate, it killed my effort of migrating whole history to GIT.

Second Trial: Migrating without the history. Successful!

Third Trial: Converting SVN externals to GIT sub-modules. Successful eventually!

Add old externals as sub modules were relatively easy. However, when I tried to remove them I had a hard time. Of course, stackoverflow came to rescue, as the solution found at here.


  1. Delete the relevant section from the .gitmodules file.
  2. Delete the relevant section from .git/config.
  3. Run git rm --cached path_to_submodule (no trailing slash).
  4. Commit
  5. Delete the now untracked submodule files
  6. rm -rf path_to_submodule



However, even after I followed the steps, I still received the following errors as the following:

A git directory for xxx is found locally with remote(s):<br/><br/>

So later I found that I also need to delete the relevant folders in .git\modules.

...

But after the migration, my experience with GIT has been relatively smooth.

So far. So good.


0 comments:

Post a Comment