Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Last active November 5, 2018 18:25
Show Gist options
  • Save diegopacheco/10acb49ac6804aea2ebec30e6abcfd28 to your computer and use it in GitHub Desktop.
Save diegopacheco/10acb49ac6804aea2ebec30e6abcfd28 to your computer and use it in GitHub Desktop.
Git: Create and Apply Patches

Create a PATCH from DIFF

git remote add remote_other https://github.com/user/some.git
git remote -v
git fetch remote_other
git diff --no-prefix remote_other/master..master > 01.patch

Apply a PATCH from DIFF

git apply --stat 01.patch
patch -p0 < 01.patch
git diff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment