-
-
Save danimesq/ce610fa4d497239ec15db81593028188 to your computer and use it in GitHub Desktop.
Add all symlinks to your commit π
This file contains 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
#!/bin/sh | |
# | |
# The command should be run in the git repository root. | |
# It adds all symlinks to a .gitignore file that aren't in there already. | |
for f in $(git status --porcelain | grep '^??' | sed 's/^?? //'); do | |
if test -L "$f" | |
then | |
test -L "$f" && git add $f; | |
elif test -d "$f" | |
# then | |
# find ${f%/} -type l -not -exec grep -q "^{}$" .gitignore \; -print >> .gitignore | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment