Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignoring symlinks in git

Is there a way to make git completely ignore symlinks (leave them in the tree, but not create them on checkout)? Alternatively, is there a way to make git convert between symlinks on linux and shortcuts on windows?

Context: I'm using git with some LaTeX files on both windows and linux. On linux, I have a large number of style files stored outside the repo, and symlinked to from a bunch of places. It'll work fine if git turns them into shortcuts on windows (I have the same surrounding directory/file structure), or if git ignores them completely, and doesn't check them out (I have the style files in my LaTeX distribution on windows).

like image 285
Jason Gross Avatar asked Mar 04 '11 05:03

Jason Gross


1 Answers

On the "ignoring symlink" side, you could set the config core.symlinks configuration variable to false (as a local config within the Windows Git repo):

Symlinks would be checked out as small plain text files that contain the path of the file system object that it links to, but without creating said target object.

like image 123
VonC Avatar answered Nov 15 '22 21:11

VonC