Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git-svn and Eclipse?

Is there a plugin for Eclipse for git-svn? I'm looking for a way to handle the SVN repo with Git (for fast branch switching etc.)

like image 847
Konrad Garus Avatar asked Apr 13 '11 21:04

Konrad Garus


People also ask

Can you use Git and SVN together?

Git svn can be used to create branches, but I wouldn't recommend using this feature. Git cannot merge SVN branches, so do not merge sync'ed SVN branches in Git.

Can I use Git with Eclipse?

Via the Eclipse IDE you can perform Git commands like staging, commit, merge, rebase, pull and push.

What is SVN repository in Eclipse?

Eclipse is an open-source and free, java-based development platform. It is well known for its excellent plug-ins that allow developers to develop and test code written in different programming languages. Eclipse IDE support built-in integration for Subversion.

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

It does not look like there is a Git plugin for Eclipse that supports git-svn yet.

EGit appears to be the most active and popular Git plugin for Eclipse at the moment and it does not support git-svn, but there isn't anything stopping you from using EGit with Eclipse and interacting with git-svn via command line (or via tortoise git for example).

Eclipse bug 315264 is the EGit bug for supporting git-svn, and it looks like something that the maintainers of EGit are willing implement, but they have other priorities atm. So make sure you vote for this bug if you want the feature.

like image 190
ztatic Avatar answered Oct 17 '22 01:10

ztatic


EGit is the only Git plugin for Eclipse at the moment. It doesn't support git-svn. But there is a way to make EGit work with your Subversion repository and this approach works well with any other Git client.

SubGit is the server-side solution that enables Git access to your Subversion repositories as well as Subversion access to Git repositories. You may refer to SubGit documenation for more details, but in general they are quite straightforward:

$ subgit configure --layout auto $SVN_URL $GIT_REPO
# Adjust $GIT_REPO/subgit/config
#     to specify your branches, tags and other settings
# Adjust $GIT_REPO/subgit/authors.txt 
#     to introduce svn author names to their git counterparts
# Adjust $GIT_REPO/subgit/passwd
#     in case you have no SVN credentials cached on your machine
$ subgit install $GIT_REPO
$ ... translating ... a little git is gonna born right here ... 
$ TRANSLATION SUCCESSFUL

After that:

  1. You have Git repository at $GIT_REPO synchronized with SVN repository at $SVN_URL; this sync is reliably bi-directional, i.e. both SVN and Git repositories remain writable and SubGit takes care of changes from both sides.

  2. SubGit has installed hooks into $GIT_REPO/hooks directory which are triggered on every git push to that repository.

  3. SubGit polls SVN repository in order to fetch new revisions.

Please note that your teammates may use the same mirror for sending their changes to Subversion repository. In this case you should setup Git server, fortunately, SubGit supports virtually every Git server available at the moment:

  • Apache HTTP server with git-http-backend, GitLab, Gitosis, Gitolite: supported out of the box;
  • Atlassian Bitbucket Server: in this case you can use SVN Mirror add-on which is built on SubGit engine;
  • Gerrit: you'd need to install SubGit plugin for Gerrit in this case;

Disclaimer: I'm SubGit developer; SubGit is commercial software with free options for small teams, Open Source and Academic projects.

like image 27
vadishev Avatar answered Oct 17 '22 02:10

vadishev