Symlinks in git repos checked out with Eclipse
wonko| Sun 21 September 2014The other day I was chasing ghosts for half a Day: I had a git repo in which all Symlinks
where replaced with a one line file containing the link target. WTF?
Only after a while it dawned on me that the only difference was that I had cloned the repo with Egit(Eclipse).
Egit is implemented in Java. Java has no symlink support (up to Java 7). OK. But why no symlinks with native git?
Because it was told so. The core section in the .git/config
file looked like this:
[core]
repositoryformatversion = 0
filemode = true
bare = false
symlinks = false
logallrefupdates = true
Notice 'symlinks = false'. Delete it and you are good for native git. You may have to reset/re-checkout.
But what about Eclipse/Egit?
There is a long running Bug in Eclipse Bugzilla: #354367
Wich says it is done for JGit the underlying library for egit. When you follow the referenced Bugs there it is also
said that this is done for Java 7/Egit. I am running Eclipse with Java 7 so where is it?
Hidden.
There is an extra Installable in the egit software repo in eclipse: Optional Java 7 libraries.
In Eclipse go to Help → Install New software.. → In the Work With: Dropdown select
egit - http://download.eclipse.org/egit/updates
open the JGit Tree and install:
Java Implementation of Git - optional Java 7 libraries
Restart Eclipse. Clone a repo and there you are: Symlinks.