Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git, SVN and Eclipse workflow

I am trying to adopt the following workflow:

  1. git svn clone a svn repository through command line (egit doesn't support git-svn)
  2. Open the project in eclipse with egit since I rather use egit to branch, merge, commit etc...
  3. When i'm ready commit the changes back, I use use git svn dcommit to commit back to svn

I am having trouble with step number 2, don't understand how to import a git project, eclipse tells me i can't import it to use the same directory it's currently in because another project with the same name is already there. this is confusing.

Anyone knows how to do this ? Also would like to hear other workflow examples that uses egit and git svn. I am aware that it is better to do it all through command line, however, I am trying to ease the move to git for fellow developers in my team, who are not used to command line interface etc...

like image 702
Michael Avatar asked May 03 '12 12:05

Michael


People also ask

Can I use Git and SVN at the same time?

No interaction between them.

What is difference between SVN and Git?

The difference between Git and SVN version control systems is that Git is a distributed version control system, whereas SVN is a centralized version control system. Git uses multiple repositories including a centralized repository and server, as well as some local repositories.


2 Answers

I've worked briefly with the egit plugin (I actually recently stopped using it and just use msysgit as my Git guiclient and run it separately from Eclipse). I find Eclipse very busy as is and adding this plugin slows it down (for me at least).

What I did when setting up an already cloned project in Eclipse:

  1. In Eclipse. File -> Import -> Existing Project into Workspace

  2. Select root directory of project. Do NOT check copy projects into workspace. Click finish.

  3. After project has been imported. Right click on project, go to Team -> Share Project

  4. Select Git as a repo type, click next

  5. Check use or create repo in parent folder of project. Since you already cloned the project it will be tracked with git. When you check this option it will show the project, the path, and the repo (.git).

  6. Click finish and you will be all set.

like image 105
mkez00 Avatar answered Oct 03 '22 20:10

mkez00


I think you'd better use SubGit instead of git-svn.

SubGit works on a server side. It synchronizes all the modification between Subversion and Git repositories automatically on every incoming modification from either side.

From the client perspective SubGit enabled repository is a usual Git repository, so you may pull from and push to it. Please refer to SubGit documentation or SubGit vs. git-svn comparison for more details.

like image 26
vadishev Avatar answered Oct 03 '22 19:10

vadishev