git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Windows symlinks

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 24, 2008, 23:28 UTC
Message-ID
<m3od5qjtv1.fsf@localhost.localdomain>
In-Reply-To
<911589C97062424796D53B625CEC0025E4618F@USCOBRMFA-SE-70.northamerica.cexp.com>
Patrick Higgins <Patrick.Higgins@cexp.com> writes:
> It looks like one of the bigger (biggest?) hurdles for git adoption
> at my company is going to be handling symlinks on Windows. We may be
> able to sidestep the issue [...] by [...] run[ning] Linux
> in a virtual machine [...]
If only MS Windows supported other filesystems which have symlinks...
Show 13 quoted lines
> Has anyone thought about a way for git to handle symlinks? Vista
> seems to have added native symlinks, but you need have elevated
> privilege to create them. NTFS junction points seem helpful for
> older versions of Windows, but don't work for anything except
> directories, and seem to be dangerous to use with tools that do
> recursive deletes. Neither junction points nor native symlinks sound
> like great options.
> 
> Cygwin's clever symlink trick seems to work pretty well in
> practice. I'm not exactly sure what it's doing, but it seems to
> create a shortcut that it's own programs understand. Some other
> non-Cygwin programs seem to understand them, too, but Java does not
> which is a big problem for me.

First, I think that both "git on Windows" solutions, namely Cygwin and msysGit port, don't use symlinks either in installed programs, nor in repository layout.

Second, the problem there can be _only_ if your repository contains (or contained) symlinks, and then it is your own damn fault. I don't know how Cygwin, or msysGit deals with symlinks in a wirking directory, but you can work around symlinks (although in a bit unwieldy way) by using `core.symlinks' configuration variable; see git-config(1):

 core.symlinks::
        If false, symbolic links are checked out as small plain files
        that contain the link text. git-update-index(1) and git-add(1)
        will not change the recorded type to regular file. Useful on
        filesystems like FAT that do not support symbolic links. True
        by default.
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Jay SoffianNext: patrick.higgins@cexp.com
Message 4 of 9 in “Windows symlinks”
  1. patrick.higgins@cexp.comJun 24, 2008
  2. Avery PennarunJun 24, 2008
  3. Jay SoffianJun 26, 2008
  4. Jakub NarebskiJun 24, 2008
  5. patrick.higgins@cexp.comJun 24, 2008
  6. Avery PennarunJun 25, 2008
  7. patrick.higgins@cexp.comJun 25, 2008
  8. Andreas EricssonJun 26, 2008
  9. Robin RosenbergJun 24, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.