在哪里git init为Java项目? [英] Where to git init for Java project?

查看:161
本文介绍了在哪里git init为Java项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了工作空间 TestWorkspace ,并在其中创建了项目 Testing Project (现在有code> .settings , src bin 文件夹和 .classpath .project 文件)。我将在这个项目下添加我的代码,我想在gitHub上托管这个项目。为了做到这一点,我必须要 git init

I've created workspace TestWorkspace and in it, I created project Testing Project(now which has .settings, src, bin folders and .classpath, .project files). I will add my code under this project and I want to host this project on gitHub. In order to do that, I'll have to git init

我应该在哪里 git init ?在工作区文件夹 TestWorkspace 或项目文件夹测试项目?什么是理想的方式,以便进一步我不会面临问题?

Where should I git init? In workspace folder TestWorkspace or project folder Testing Project? What is the ideal way so that going further I won't face issues?

推荐答案

从Egit用户指南:

http://wiki.eclipse.org/EGit/User_Guide


将项目的根文件夹设置为
可能不太好,您的存储库

It is probably not a good idea to make a project the root folder of your Repository

原因是您永远无法在
此存储库中添加另一个项目,因为.project文件将占用根文件夹;您
仍然可以将项目添加为子文件夹,但是这种项目
嵌套已知会导致很多问题。在
订单中添加另一个项目,您必须将项目移动到存储库中的
子文件夹,并将第二个项目添加为另一个
子文件夹,然后才能提交此更改。

The reason is that you will never be able to add another project to this Repository, as the .project file will occupy the root folder; you could still add projects as sub-folders, but this kind of project nesting is known to cause lots of problems all over the place. In order to add another project, you would have to move the project to a sub-folder in the Repository and add the second project as another sub-folder before you could commit this change.

工作区文件夹TestWorkspace中的 git init 不是一个好主意。

It's not a good idea to git init in workspace folder TestWorkspace.

将您的Repository保存在Eclipse Workspace之外是一个好主意。

It is a good idea to keep your Repository outside of your Eclipse Workspace.

这篇关于在哪里git init为Java项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆