Created
May 11, 2020 19:41
-
-
Save whoward/7b2282d1e9d268b9dcd6308e4bc4ab34 to your computer and use it in GitHub Desktop.
bash function to apply a diff on a single file from another commit
This file contains hidden or 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
# example: cpf c0fbe4 path/to/file.txt | |
function cpf() { | |
git diff -R $1 $2 | git apply | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment