2

Problem:
I moved an Eclipse project from a Linux machine to a Windows 8.1 machine but cannot get the Git repositories to load on the new Windows Box. I use eGit within Eclipse (and am NOT a sophisticated user of GIT).

I moved the projects from the Linux box to the Windows box by manually copying the entire project directory and all sub-directories. My Git/eGit files seem to be stored, for example, in D:\TheUser\Programming\eclipse\project1\project1gui\.git.

When I launch Eclipse on the Windows box, I get an eGit error and none of my repositories open. The error is:

java.nio.file.InvalidPathException: Illegal char <:> at index 66: \home\TheUser\Programming\eclipse\project1\project1gui.git:\home\TheUser\Programming\eclipse\project2.git:\objects

NOTE: the paths in the error seem to be the old Ubuntu/Linux paths.

I understand the error, there is a Windows invalid character in the path, but I simply cannot find a config file or other means to reconfigure eGit manually (I don't want to lose my repositories).

Specs:
Eclipse Kelper SR2
JDK 1.7
Windows 8.1 x64 Pro
(Moved from Ubuntu x64)

Redoishi
  • 68
  • 1
  • 8
SaB
  • 747
  • 1
  • 9
  • 25
  • Recommendation: Use sourceTree instead of the eclipse plugin. My head hurts just thinking about the horrors I went through with that plugin. – Mason T. Mar 10 '14 at 21:05
  • I believe the answer is here http://stackoverflow.com/questions/1484648/how-to-migrate-git-repository-from-one-server-to-a-new-one – Mason T. Mar 10 '14 at 21:10

3 Answers3

14

In case anyone else stumbles on this from Google (Like I did), the problem is that the path separator in your .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs is wrong. (That's from the root of your workspace)

So, if you open that file with the editor of your choice and replace all ":" characters in GitRepositoriesView.GitDirectories and GitRepositoriesView.GitDirectories.relative with ";" and restart Eclipse, things should start working again.

Archenoth
  • 354
  • 5
  • 14
  • 1
    I had the same problem with the colon, and this answer was the solution to my problem and everything is working again :) – manuelwaldner Feb 26 '19 at 06:24
  • I had a similar problem (same error):In my case I needed to remove any non-existing path entries from "GitRepositoriesView.GitDirectories". This solved my problem as well. Thanks. :-) – Jacky Nov 09 '20 at 18:18
0

I had same issue on Eclipe Version: 2019-03 (4.11.0). The root cause looks to be that default ${user.home}/.ssh is appending the new location of your keys with an extra \ at the end. This may be a Eclipse bug in 2019

The solution I used was to go to Preferences -> Network Connections -> SSH2 and overwrite the SSH2 home with new folder where I put the correct ssh key to connect to git and now is working fine.

-1

You need to go into the .git/config file in your repo, and modify the remote to point to the new url.

Mason T.
  • 1,567
  • 1
  • 14
  • 33