Git has a built in way to create patches and Github has a great write up on this.
The git format-patch command is useful if all your changes are committed and you want to create a patch of certain commits.
Sometimes however you have changes that you can’t or don’t want to commit for whatever reason. Git lets you easily create a standard patch file that you can apply on another clone or branch.
1 2 3 4 5 | |
If you have an existing git diff output that didn’t use the --no-prefix argument, you can just apply the patch like this:
1
| |
Voila.