简体   繁体   English

使用GIT处理Java Eclipse项目的正确方法

[英]Right way of working Java Eclipse project with GIT

What's the right way of working with an Eclipse Java project with GIT? 使用GIT处理Eclipse Java项目的正确方法是什么?

I have the plugin EGIT installed and a simple java project. 我安装了EGIT插件和一个简单的Java项目。 I did a commit/push of this java project by using the GIT bash console. 我通过使用GIT bash控制台对该Java项目进行了提交/推送。 I pushed only the source files. 我只推送了源文件。

Is that correct? 那是对的吗? Should I use Eclipse IDE somehow to make the init, commit and push? 我是否应该以某种方式使用Eclipse IDE进行初始化,提交和推送? I couldn't find how to do this in Eclipse. 我找不到如何在Eclipse中执行此操作。

How should I retrieve the project from another machine? 我应该如何从另一台机器上检索项目? Should I use GIT console to retrieve the project or Eclipse? 我应该使用GIT控制台来检索项目还是Eclipse?

I did the procedure in several ways, but they failed. 我以几种方式执行该过程 ,但是它们失败了。

The generic answer is: whatever works for you, works. 通用的答案是:任何对您有用的东西都可以。

We have a large git repository, and users with eclipse and intellij. 我们有一个大型的git存储库,并且用户使用eclipse和intellij。

Some IDE users use specific plugins, such as Egit, others simply use the "default" support that most IDEs are shipped with. 一些IDE用户使用特定的插件,例如Egit,而其他一些用户仅使用大多数IDE附带的“默认”支持。 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. 就我个人而言,我仅依靠IDE向我显示文件的历史记录,或者有时仅快速浏览修订版本。 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. 您可以使用eclipse来管理git存储库的各个方面,但不必这样做。

Personally, I suggest to first get a good book on git, and to then extensively study the command line tooling. 就个人而言,我建议先获得一本有关git的好书,然后再广泛研究命令行工具。 You also seem to be confused between the responsibilities of your IDE, and your source code management system. 您还似乎在IDE的职责与源代码管理系统之间感到困惑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM