Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 24 lines (20 sloc) 551 Bytes
#!/bin/sh
# Set email for all git repositories under the current directory.
EMAIL="mike@mikemcquaid.com"
CURRENT=$PWD
# Set to newline to loop over find output correctly on spaced paths.
IFS="
"
find -L "$CURRENT" -name .git -print0 | while read -d '' -r SCM
do
DIRECTORY="$(dirname "$SCM")"
cd "$DIRECTORY" || continue
if [ -d .git ]
then
if ! git config --local --get user.email >/dev/null
then
echo "== Setting email to $EMAIL for $(basename "$DIRECTORY")"
git config --local --add user.email $EMAIL
fi
fi
done