-
-
Save anver/ac170600b02158ac38913f2ddd645364 to your computer and use it in GitHub Desktop.
Copy a commits from one Git repo to another
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy a single commit from one repo to another | |
git --git-dir=../path/to/repo/.git format-patch --keep-subject -1 --stdout COMMIT | git am --3way --keep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment