We have a shared directory (call it /shared) that we keep automatically up to date with our master git branch, by running these commands whenever there is a push to master:
git reset --hard HEAD git clean -f -d git pull
This works for the most part. However there is a directory /shared/media that we don't want to be touched, even though there is a "media" symlink checked into git.
I've added "media" to .git/info/exclude, but regardless, "git reset --hard HEAD" removes /shared/media and replaces it with the checked in symlink.
Is there any way to get "git reset --hard HEAD" to leave this directory alone, other than e.g. by moving it out of the way beforehand and restoring it afterwards?