0

I am (finally) in the progress of migrating a svn repository to git. Transforming the repo itself was not much of a problem, but I cannot make Eclipse play well with the result. (I am kinda new to git, btw).

The repo contains amongst lots(!) of other things a subdirectory with java code which I would like to use in Eclipse as the base directory of a project. The SVN plugin offered a wizard I could use (New > Other > SVN > Checkout Projects from SVN > svn://host/repo/subdir), but the Git plugin does not seem to offer such kind of workflow. Its import only allows for repository roots to be entered.

Is there a way to make git do my bidding

  • without ripping my repo into subrepositories
  • without creating some kind of git-svn proxy
  • by somehow connect the project to the repo after creation?

Does anyone have any ideas?

I am running Eclipse 12/2022, Git Integration 6.4.0, Subclipse 4.3

  • AFAIK, with git you either clone the whole repo or nothing. With Subversion, you can check out a subdirectory, but with git you can't. – bahrep Jan 09 '23 at 14:27
  • "Its import only allows for repository roots to be entered." Show us, because many, many Git repositories contain more than one Eclipse workspace project. – nitind Jan 09 '23 at 16:58
  • Did you tried _File > Open Projects from File System..._? – howlger Jan 10 '23 at 10:21
  • Possible duplicate of https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository and https://stackoverflow.com/questions/180052/checkout-subdirectories-in-git Please read following answers: https://stackoverflow.com/a/13738951/9983181 https://stackoverflow.com/a/2303645/9983181 – HakerMSL Jan 10 '23 at 12:09

1 Answers1

0

As you are migrating from SVN to GIT personally I strongly suggest you to change also way of working to use GIT in a more efficient way. So I think that you should consider if it's worth to split it into separate repositories (which is my suggestion).

It's like with a mobile phone and a smartphone. It's hard to change standard mobile phone and replace it with a new smartphone without changing your habits and way how you are going to use it, right? Or similar with migration from Windows to MacOS. It's hard to switch to MacOS and use it like it's a Windows system.

However if you are still stick to SVN way of work please read about sparse-checkout: https://stackoverflow.com/a/13738951/9983181

https://stackoverflow.com/a/2303645/9983181

and git submodules:

https://git-scm.com/book/en/v2/Git-Tools-Submodules

HakerMSL
  • 91
  • 9