0

What's the right way of working with an Eclipse Java project with GIT?

I have the plugin EGIT installed and a simple java project. I did a commit/push of this java project by using the GIT bash console. I pushed only the source files.

Is that correct? Should I use Eclipse IDE somehow to make the init, commit and push? I couldn't find how to do this in Eclipse.

How should I retrieve the project from another machine? Should I use GIT console to retrieve the project or Eclipse?

I did the procedure in several ways, but they failed.

Draken
  • 3,134
  • 13
  • 34
  • 54
vico
  • 17,051
  • 45
  • 159
  • 315

1 Answers1

0

The generic answer is: whatever works for you, works.

We have a large git repository, and users with eclipse and intellij.

Some IDE users use specific plugins, such as Egit, others simply use the "default" support that most IDEs are shipped with. Such users simply go command line, or maybe, some other 3rd party tool.

Me, personally, I only rely on the IDE to show me the history of a file, or sometimes to quickly diff to revisions. Anything else I do on the command line.

From that point of view, as said: anything that works for you, works for you. You can use eclipse to manage the aspects of a git repository, but you don't have to.

Personally, I suggest to first get a good book on git, and to then extensively study the command line tooling. You also seem to be confused between the responsibilities of your IDE, and your source code management system.

GhostCat
  • 137,827
  • 25
  • 176
  • 248
  • I do comit/push and clone to another machine by using GIT console without problem. But how to create java project in another machine from cloned repository? – vico Sep 10 '18 at 09:25
  • That is the point: the IDE project definition has **nothing** to do with git. In other words: either you *create* a new project in your IDE from a checkout out clone, **or** you put the project definition files **into** the git repository. In other words: if you want **share** your project definitions, then they need to be part of the commits. That is what I meant: you throw together things that do not belong together conceptually. – GhostCat Sep 10 '18 at 09:27