默认情况下,git是否将eclipse项目文件从新的repo中排除? [英] Does git exclude eclipse project files from a new repo by default?

查看:104
本文介绍了默认情况下,git是否将eclipse项目文件从新的repo中排除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾尝试将几个eclipse项目推送到github回购站。每次我在后来克隆时遇到麻烦或者将它们提取回日食。原因似乎是,当我执行'git add'时,特定于Eclipse的项目文件(.project,.classpath等)不会被执行。我尝试过研究gitignore文件,但找不到默认创建的文件。 .git / info / exclude中的文件似乎也不相关。我搜索了StackOverflow和互联网,并没有提到这一点。所以很明显,我是唯一发生过这种事的人,也是唯一无法自己想出来的人。我需要明确地将这些项目文件放在回购站中(在用'git add。'添加整个项目之后)?

解决方案

如果这些Eclispe项目不在本地的git仓库中,您可以在项目的根目录下创建一个git仓库,并且您应该可以添加带有'?'的文件,包括 .project .classpath



(From Egit用户指南 /

EGit Eclipse选项<从Git导入> Git>项目应该引用所有文件,包括 .project .classpath




I have tried pushing several eclipse projects to github repos. Every time I have trouble later cloning or fetching them back into eclipse. The reason seems to be that the eclipse specific project files (.project, .classpath, etc) are not staged when I do a 'git add .' I have tried researching gitignore files but cannot find one created by default. The file in .git/info/exclude also seems unrelated. I've searched StackOverflow and the internet at large and find no mention of this. So obviously I'm the only person this has every happened to or the only dummy who can't figure it out on my own. Do I need to stage those project files explicitly to include them in them in the repo (after adding a whole project with a 'git add .')?

解决方案

If those Eclispe project weren't in a git repo locally, you can create a git repo at the root directory of your project, and you should be able to add the files with a '?' on them, including the .project and .classpath:

(From Egit User Guide / Create Repository section)

But if the project is already in a git repo, check first in the git command-line those files status. In doubt, always fall back to the CLI (command line interface), with any local git installation (for instance for Windows: msysgit)

The EGit Eclipse option "Import > Git > Projects from Git" should reference all the files, included the .project and .classpath

这篇关于默认情况下,git是否将eclipse项目文件从新的repo中排除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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