1

I am using:

Eclipse Java EE IDE for Web Developers (Windows 64 bit)

  • Version: Luna Service Release 1 (4.4.1);
  • Build id: 20140925-1800.
  • Eclipse EGit 3.4.1.201406201815-r (Came with eclipse luna)

Problem:

After cloning git repos and importing the projects, I am able to view and interact with the locally cloned repos through the EGit perspective. After several days working with no issues, the EGit perspective will suddenly show no Egit repos. The git repos are still there on my file system, and work fine with Git Bash. The imported projects are also available in eclispe.

What I have Tried:

  1. Restarting EGit. No change.
  2. Re-adding local repos to eclipse through the EGit perspective. The Add... dialog displays my repos and I select teh Finish button. A task dialog is briefly shown and completes with no errors, but no repositories appear.
  3. Delete all projects, leaving file contents on disk; restart eclipse; re-add existing local git repo. Same outcome as #2.
  4. Re-install Eclipse Luna and delete workspace/.metadata. Same outcome as #2.

Question:

Why is this happening and how do I properly recover from it?

Update

I noticed git was logging errors in the Error Log view:

java.io.IOException: User config file Y:\.gitconfig invalid org.eclipse.jgit.errors.ConfigInvalidException: Cannot read file Y:\.gitconfig
at org.eclipse.jgit.internal.storage.file.FileRepository.loadUserConfig(FileRepository.java:236)
at org.eclipse.jgit.internal.storage.file.FileRepository.<init>(FileRepository.java:190)
at org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:92)
at org.eclipse.jgit.storage.file.FileRepositoryBuilder.create(FileRepositoryBuilder.java:110)
at org.eclipse.egit.core.RepositoryCache.lookupRepository(RepositoryCache.java:55)
at org.eclipse.egit.ui.internal.repository.RepositoriesView.initRepositoriesAndListeners(RepositoriesView.java:498)
at org.eclipse.egit.ui.internal.repository.RepositoriesView.access$8(RepositoriesView.java:490)
at org.eclipse.egit.ui.internal.repository.RepositoriesView$14.run(RepositoriesView.java:651)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Caused by: org.eclipse.jgit.errors.ConfigInvalidException: Cannot read file Y:\.gitconfig
at org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:173)
at org.eclipse.jgit.internal.storage.file.FileRepository.loadUserConfig(FileRepository.java:234)
... 8 more

Caused by: org.eclipse.jgit.errors.ConfigInvalidException: Invalid line in config file
at org.eclipse.jgit.lib.Config.fromText(Config.java:1087)
at org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:161)
... 9 more

I deleted the .gitconfig file and was then able to add the repositories. This git config file was not in my workspace or eclipse install dir, so the problem was persisting through my attempts to re-install eclipse. Still not sure how this file became corrupted, or why it is in my Y: dirve, but removing it seems to resolve the issue.

1 Answer 1

2

Steps taken to resolve:

  • Examine the Errors View in eclipse and look for errors associated with git repositories.
  • In my case a corrupt .gitconfig file was causing my repositories to disappear from the git repositories view as well as causing the add local repository function to fail.
  • I removed the corrupt file and have been working fine ever since.

Not the answer you're looking for? Browse other questions tagged or ask your own question.