Having had a similar itch to scratch (altough only for some files of a given repository) this script proved to be really helpful: git-import
The short version is that it creates patch files of the given file or directory ($object
) from the existing repository:
cd old_repo
git format-patch --thread -o "$temp" --root -- "$object"
which then get applied to a new repository:
cd new_repo
git am "$temp"/*.patch
For details please look up: