Skip to content

Instantly share code, notes, and snippets.

@ashug0001
Last active May 10, 2023 05:13
Show Gist options
  • Save ashug0001/53a593a2d6b5845785047ad99adc9722 to your computer and use it in GitHub Desktop.
Save ashug0001/53a593a2d6b5845785047ad99adc9722 to your computer and use it in GitHub Desktop.
create_patch

Make changes to the files you want to apply depending on scenario.

  1. Once changes are done, add them to stash buy running below 👇 command:
git stash
  1. Once stash is done, create a patch file for the diff
git stash show -p stash@{0} > {file_name}

Now you can apply these changes or reverse (once applied)

// apply changes
git apply {file_name}

// reverse applied changes
git apply {file_name} --reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment