Skip to content

Instantly share code, notes, and snippets.

@n13i
Created January 27, 2016 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n13i/12a625dfcc4f4b220837 to your computer and use it in GitHub Desktop.
Save n13i/12a625dfcc4f4b220837 to your computer and use it in GitHub Desktop.
#!/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