Skip to content

Instantly share code, notes, and snippets.

@flesheater
Last active November 21, 2018 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flesheater/8b742bb76e7b3da57bc0239905288de8 to your computer and use it in GitHub Desktop.
Save flesheater/8b742bb76e7b3da57bc0239905288de8 to your computer and use it in GitHub Desktop.
Simple patch create and patch apply with git
# Simple create patch from changes in your git repo
git diff HEAD path-to-changed-file > description-of-patch.patch
# Creating a patch from a special branch.
# 1. I am on a feature page.
# 2. I did my changes + made a commit.
# 3. Creating the patch
git diff dev_branch > short-description-TICKETID-COMMENTID.patch
# Simple apply a patch
git apply -v description-of-patch.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment