From 1c3ed4cddb492765a5ad88df1e8ff7b7ab4c4d3d Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sat, 28 Mar 2020 15:46:34 +0000 Subject: [PATCH] [TOOLS] Add command which imports a file with it's history --- bin/git-import | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 bin/git-import diff --git a/bin/git-import b/bin/git-import new file mode 100755 index 0000000000..da86dba62d --- /dev/null +++ b/bin/git-import @@ -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