6

I am used to using Eclipse with SVN and CVS.

Now I want to use GIT via EGIT.

The goal is to have a local repository, not in the eclipse work-space, that my changes go into. That way, I can make changes, commit them, and have a repository with the changes that I can back up (at least, that's how it works in SVN).

Following the user's guide, I find it creates the repository within my Eclipse project in the workspace, which is recommended against. What am I missing?

Steps:

  • Create a Java project in Eclipse (Test)
  • On Project right click->Team->Share Project->Git
  • ...Next - shows "Configure Git Repository" Panel ...the only repository it will let me create is inside the project.

Huh?

SChaser
  • 61
  • 1
  • 2

2 Answers2

2

You can create multiple projects under one repo in EGit, see http://wiki.eclipse.org/EGit/User_Guide#Creating_a_Git_Repository_for_multiple_Projects In that case, EGit will do it automatically.

You can also use the Git Repository view to create an empty git repo outside of the workspace. See http://wiki.eclipse.org/EGit/User_Guide#Creating_a_Repository After that, you can create new java projects and specify the external git repo subdirectory as their location.

Paul Webster
  • 10,614
  • 1
  • 25
  • 32
0

Since:

  • you can create a java project outside of the workspace
    (see option "create project form existing source": the .project and .classpath will be created in the parent directory of the directory you will select as containing the sources)
  • Egit will create the .git where the .project and .classpath are created

you will have a repo outside of the Eclipse workspace.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This still leaves me with the repository inside the project, although outside the workspace. I guess I wasn't clear enough. I want a repository with all my projects in it, not all my projects with repositories in them. Is a "push" each time the only way to do that? If so, that is much less useful than svn, where a commit puts my changes into an external repository. – SChaser Jun 12 '11 at 17:23
  • @SChaser: it is usually preferable to have separate repository per project. See http://stackoverflow.com/questions/984707/what-are-the-git-limits/984973#984973. Egit doesn't, as far as I know, offer the possibility to version several projects within *one* repo. – VonC Jun 12 '11 at 19:39
  • thanks for your answers. That isn't quite the issue. What I want is to be able to have the git "local repository" outside my eclipse project in an arbitrary directory. Then I can have all my local repositories under a single parent directory which is a convenient place to back up from. My usage pattern is unusual because I am working as an individual rather than a collaborator, so the local repositories are adequate as my master directories. – SChaser Jun 12 '11 at 23:32