Skip to content

Instantly share code, notes, and snippets.

View pawigor's full-sized avatar

Igor Pavlichenko pawigor

View GitHub Profile
@joeyates
joeyates / git-copy-file-history.sh
Last active February 23, 2023 17:34
Copy a commits from one Git repo to another
# Copy all modifications to a file from one repo to another
for c in `git --git-dir=../path/to/repo/.git log --reverse --pretty=tformat:"%H" -- path/to/file`; do
git --git-dir=../path/to/repo/.git format-patch --keep-subject -1 --stdout $c | git am --3way --keep;
done