gitignore为eclipse项目的文件夹 [英] gitignore for folder of eclipse projects

查看:211
本文介绍了gitignore为eclipse项目的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在工作以下一组java swing教程,每个都是一个Eclipse项目,将它们保留在工作空间中。我在工作区文件夹(mac)中初始化一个Git仓库,并上传到github。当我在另一台计算机(linux)中下载该文件夹时,这些项目不能被识别,并且Eclipse中的打开/导入失败。说:文件夹不被识别为项目。在git中处理项目集合的最佳方式是什么?

解决方案

如果你想拥有所有的Eclipse项目数据在您的机器上,您必须将以下文件/文件夹添加到Git中:




  • .classpath

  • .project

  • .settings(folder)



确保这些不被忽略在您的本地或全球范围 .gitignore 文件。



忽略像 bin 目标文件夹,因为它们包含编译的类,不应该添加到Git。


I am working following a set of java swing tutorials, each is an Eclipse project, keep them in a workspace. I init a git repository in the workspace folder (mac), and upload to github. When I download this folder in another computer (linux), the projects are not recognized as such, and opening/importing in Eclipse fails. Says: 'Folder not recognized as project'. What is the best way to handle a collection of projects in git?

解决方案

If you want to have all of your Eclipse project data across your machines, you will have to add the following files/folders to Git:

  • .classpath
  • .project
  • .settings (folder)

Make sure that these are not ignored in either your local or globale .gitignore files.

Ignore things like the bin and target folders, since they contain the compiled classes and shouldn't be added to Git.

这篇关于gitignore为eclipse项目的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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