Creating Patches

A Git patch is a text file that contains one or more Git commits. Using GitHub you can very easily export your work into patches in order to distribute outside of typical merging and pull requests. Using patches is the common method for sharing source edits on Ascension Game Dev.

The best practice is to branch off main or development, make your changes, commit, and then create the patch based off your branch.

Open command prompt in your local repository directory. This can be done easily by clicking Repository -> Open In Command Prompt within GitHub Desktop.

commandprompt

Next type in the following command. Make sure you are still on the branch where you made your modifications. In the command replace main if you originally branched off of development.

git format-patch main --stdout > patchName.patch

createpatch

The patch file you’ve created can be found in the directory of your local repository.

You can upload your .patch file to Diffy in order to view its contents.