Created
April 7, 2022 15:58
-
-
Save m-doescode/4582223ccb5749c8c0fe0fa410565fc2 to your computer and use it in GitHub Desktop.
Convert unix symlinks in git repository to windows symlinks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Requires administrator privileges | |
| for l in `git ls-files -s | awk '/120000/{print $4}'`; do | |
| git checkout -- $l # Restore original file | |
| t=$(cat $l) # Grab the contents of the file (target) | |
| rm $l # Delete the file | |
| echo "Link: $l <==> $t" | |
| cmd /c mklink ${l//\//\\} ${t//\//\\} # Create a symlink in its place | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment