Last active
November 14, 2023 09:17
-
-
Save adRn-s/fff09e92f80dad1f5e39e689fb62e2fa to your computer and use it in GitHub Desktop.
Moving any commit (a diff-patch) throughout machines!
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
git apply --verbose 0001-name-your-file.patch | |
# Retrieving from different 'sources' | |
### from unstaged changes | |
git diff > 0001-name-your-file.patch | |
### from staged changes | |
git diff --cached > 0001-name-your-file.patch | |
### latest commit | |
git format-patch -1 HEAD | |
### specific commit | |
git format-patch -1 d173e1b | |
### from 2nd stash | |
git stash show -p stash@{1} > 0001-name-your-file.patch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment