

This alias can remove git symlinks one-by-one or all-at-once in one fell swoop. Git config -global alias.rm-symlink '!git rm-symlinks' # for back-compat. 'Note: source MUST be a path relative to the location of target'
Symbolic linker update windows#
'Create a symlink in a git repository on a Windows host.\n' \ With this information it's possible to add a few git aliases that allow for the creation and manipulation of git symlinks on Windows hosts.Ĭreating git symlinks on Windows git config -global alias.add-symlink '!'"$(cat \n' \ Thanks to Josh Lee for pointing out the fact that git commits symlinks with special filemode 120000.

Our developers are in much the same situation as OP's: a mixture of Windows and Unix-like hosts, repositories and submodules with many git symlinks, and no native support (yet) in the release version of MsysGit for intelligently handling these symlinks on Windows hosts. Q: "Has anybody already worked on such a script?" can I recursively find out the dummy "symlink" files git creates?"Ī: Yes, a post-checkout script is implementable! Maybe not as a literal post- git checkout step, but the solution below has met my needs well enough that a literal post-checkout script wasn't necessary. Q: "Is this post-checkout script even implementable? i.e. (More on this under "limitations" below.)

Q: "What, if any, downsides do you see to this approach?"Ī: There are indeed a few downsides to the proposed solution, mainly regarding an increased potential for repository pollution, or accidentally adding duplicate files while they're in their "Windows symlink" states. I was asking this exact same question a while back (not here, just in general), and ended up coming up with a very similar solution to OP's proposition.īut first I'll provide direct answers to OP's 3 questions: See this more modern answer before digging into the following deep git hacks discussion.
Symbolic linker update update#
For most Windows developers struggling with symlinks and git on Windows and the issues of sharing a repo with *nix systems, this topic is a solved problem - once you update your Windows understanding of mklink a bit and turn on Developer Mode.
