git-import 306 B

1234567891011
  1. #!/bin/bash
  2. case $# in
  3. 0) echo "No filename given" && exit 1 ;;
  4. 1) file=$1 ;;
  5. 2) file=$2; branch=$1 ;;
  6. *) echo "Too many arguments given" && exit 2 ;;
  7. esac
  8. git log --pretty=email --patch-with-stat --reverse --full-index --binary $branch -- $file | git am --committer-date-is-author-date