[TOOLS] Add command which imports a file with it's history

This commit is contained in:
Hugo Sales 2020-03-28 15:46:34 +00:00 committed by Hugo Sales
parent 0c79dfc67b
commit 1c3ed4cddb
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

10
bin/git-import Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
case $# in
0) echo "No filename given" && exit 1 ;;
1) file=$1 ;;
2) file=$2; branch=$1 ;;
*) echo "Too many arguments given" && exit 2 ;;
esac
git log --pretty=email --patch-with-stat --reverse --full-index --binary $branch -- $file | git am --committer-date-is-author-date