Skip to content

Instantly share code, notes, and snippets.

@n13i
Created Jan 27, 2016
Embed
What would you like to do?
#!/bin/sh
LIST=`find . -type d -name ".git" -prune -or -type f -print`
# lsコマンドのオプションはFreeBSD 10.1のlsコマンドを想定しているので注意
for f in ${LIST}; do
FDATE=`LANG=C ls -l -D "%a, %d %b %Y %T %z" "$f" | cut -d " " -f 9-14`
FNAME=`basename "$f"`
echo "[$FDATE] [$FNAME] [$f]"
git add "$f"
git commit --date="$FDATE" --message "Add ${FNAME}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment