Eclipse : switch workspace from svn to git (code already migrated)

599 Views Asked by At

I have a workspace that points to an SVN repository(Eclipse Mars). The code under this repository has been migrated to git. How can I point to this new git repository without breaking my current workspace?

1

There are 1 best solutions below

0
eftshift0 On

What I would do is:

  • Close eclipse.
  • Save the whole directory on a zip, just in case.
  • Save all your local change from the revisión you are working on. What I would call stash your changes in git terms
  • inside the directory of the project, run : git init .
  • Set a remote to the svn clone you made on git
  • run git fetch --all
  • Find on git the exact same revision you are working on svn
  • Run git checkout --force the-revision-id

At this point, you could delete .svn because you are already switched to git. When starting eclipse, it should just show stuff as if you are working on git, no svn.