5

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 .')?

kroysemaj
  • 53
  • 1
  • 4
  • Maybe GitBash is hiding the "invisible" files (files whose name starts with a '.' are considered as invisible on linux) – Denys Séguret Oct 08 '12 at 15:17
  • I went back and tried it again and it inexplicably worked. I haven't had time to learn the Egit plugin. I've never been able to get it to work all that well. Thanks! – kroysemaj Oct 15 '12 at 19:04

2 Answers2

4

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:

Shared project

(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

add git repo

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

I'd recommend using Egit instead of the command line in this case. While the command line is typically more powerful, Egit knows better about the logical project structure of an Eclipse project.

Bananeweizen
  • 21,797
  • 8
  • 68
  • 88