Skip to content

Instantly share code, notes, and snippets.

@mkrishnan-codes
Last active September 16, 2022 09:29
Show Gist options
  • Save mkrishnan-codes/5b78c690419ebf559f4c54c40ba60682 to your computer and use it in GitHub Desktop.
Save mkrishnan-codes/5b78c690419ebf559f4c54c40ba60682 to your computer and use it in GitHub Desktop.
Git cheatsheet

Create a patch from staged changes

git diff --cached > something.patch

Apply patch

git apply /path/to/some-changes.patch

If you want to get the diff from a remote place without storing the file:

curl https://example.com/file-0.0.1.diff | git apply 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment