EGit-存储库中的项目子文件夹 [英] EGit - Project subfolder in repository
问题描述
在使用GitHub的Eclipse Luna Service Release 1a(4.4.1)中,我在EGit 3.4.2.201412180340-r中遇到以下问题(应该是最不重要的):
I have the following problem with EGit 3.4.2.201412180340-r in Eclipse Luna Service Release 1a (4.4.1), using GitHub (which should be mostly irrelevant):
我有一个示例Java项目设置,该项目配置了EGit并连接到GitHub Repository。我提交了对 master
的一些更改示例,并将它们也推送给了他们。
I have a example java project set up that is configured with EGit and is connected to a GitHub Repository. I commited a few example changes to master
and pushed them as well.
问题是:我的存储库总是有一种奇怪的文件布局:
存储库根>
MyProjectName
> src> cf> randers>我的项目>主要> Main.java
The problem is: My repositories always have a weird kind of file layout:
Repository Root >
MyProjectName
> src > cf > randers > myproject > main > Main.java
我在GitHub上知道的大多数项目具有以下布局:
仓库根> src> cf> randers>我的项目>主要> Main.java
The most projects I know on GitHub have the following layout:
Repository Root > src > cf > randers > myproject > main > Main.java
我可以解决这个问题吗?
Can I fix that?
推荐答案
您可以克隆GitHub存储库(在Eclipse外部的命令行中),并:
You could clone your GitHub repo (in command-line, outside Eclipse), and:
-
git mv
该存储库根文件夹中MyProjectName
下的所有内容 -
git add
,git commit
和git push
这样的移动。 - 将该
.eclipse
(现在移动到本地git repo的根目录下)导入新的Eclipse工作区中。
git mv
everything underMyProjectName
in the root folder of that repogit add
,git commit
andgit push
that move.- import that
.eclipse
(now move under the root of the local git repo) in a new Eclipse workspace.
这篇关于EGit-存储库中的项目子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!