Last active
March 3, 2020 20:26
-
-
Save hamelin/4b47b6468e4c72b852052752966513b8 to your computer and use it in GitHub Desktop.
How to extract a patch file describing the change between present (`HEAD`) and an older commit in a Git repo.
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
# From source repository | |
cd repo | |
git diff-index --patch --binary --full-index <commit ID, included>^ | |
# The patch is dumped to standard output. We capture it (to file, to clipboard) and | |
# send it to the destination host. | |
# Into source repository | |
cd repo | |
git apply <path to patch file> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment