问题(tl; dr) 如何从克隆的git存储库正确导入Eclipse项目?当我提交时,我不希望在Team> Synchronize中显示一个.git文件夹,让.git文件夹位于我的项目之外的其他位置。
其他信息 我在Windows 7上使用Eclipse Indigo和Egit。 我正在使用Egit从 git.apache/ 克隆git repo (thebiz项目,确切地说),在向导中,我选择从这个新克隆的repo导入现有项目的选项。 是的,我知道我从Egit可能会有多少期望。事实上,如果有任何替代方法(外部git工具?命令行git for Windows?其他?)在Eclipse中使用git-tracked项目,将实际的.git东西保留在项目之外,我很乐意放弃Egit
解决方案我完全同意 - 我无法想象会永远是任何人提交.git文件夹的意图! p>
并且git / EGit 知道这是项目的存储库文件夹,所以应该很容易实现相应的异常 - 以便这个文件夹不会成为同步的一部分。
我知道以下内容不能解决您的问题,但是如果您控制文件在存储库中的排列方式,您就可以可以选择将Eclipse项目文件夹不是作为存储库的根文件夹,而是一个子文件夹。
这也允许你在存储库中放置不应该出现在Eclipse中的东西,甚至是哈哈多个Eclipse项目分组在一个存储库中(如果您希望这样做)。
Issue After importing an Eclipse project from a cloned git repository, I make some changes and commit - and wtf? I get a ".git" folder added to the project, the whole shebang with the heads and refs and worst of all the whole object database gets added to the project, all files/folders having that little question-mark icon signaling that the files have not been added / are not yet tracked by git. This .git folder exists in the actual Working Directory (how does that even make sense?). You can imagine what an annoyance this causes when trying to use the "Synchronize" tool/view (which is supposed to make life easier for committing, you can see all the changes and changed files and diffs).
Question (tl;dr) How to correctly import an Eclipse project from a cloned git repository? I don't want a .git folder showing up in "Team > Synchronize" when I commit, let the .git folder reside somewhere else outside of my project.
Additional Info I'm on Windows 7 using Eclipse Indigo and Egit. I am using Egit to clone a git repo from git.apache/ (the ofbiz project, to be exact) and in the wizard I choose the option to import an existing project from this newly cloned repo. Yes I am aware of how little I may expect from Egit. In fact, if there are any alternative ways (external git tool? command line git for windows? other?) to use a git-tracked project in Eclipse which keeps the actual .git stuff out of the project, i'd gladly abandon Egit.
解决方案I totally agree - I can't imagine it would ever be anyones intent to commit the .git folder!
And git/EGit knows that this is the repository folder of the project, so it should be easy to implement the appropriate exception - so that this folder does not become part of the synchronization.
I know the following does not solve your problem, but in cases where you control the way files are layed out in the repository, you could choose to have the Eclipse project folder not be the root folder of the repository, but rather a sub-folder.
This also allows you to have stuff in the repository that should not show up in Eclipse, or even have multiple Eclipse projects grouped in one repository (if you should wish to do so).
更多推荐
如何将.git文件夹保存在Cloned Eclipse项目中
发布评论