Translations:Source code management/49/en

Creating patches from git
There are times when one may need to create a patch instead of submitting a PR. The following workflow explains how to do this:  Make sure you are in the correct branch (i.e. not the master branch) by checking with git branch -v  Create the patch: we do this by using the git format-patch command which we patch against the master branch and redirect to STDOUT. We create the patch in the directory outside of the source build (in order not to pollute the source dir itself, this is optional as you can decide the location wherever you want the patch to be created) git format-patch master --stdout > ../patch.name.patch  Another method is to use git format-patch HEAD^ or git format-patch HEAD~1 The ^ or 1 can be changed to number of commits that should be covered i.e.: ^^^ or ~3. git format-patch HEAD^  It will create a patch or series of patches with file name format XXXX-commit-message.patch. An example: 0001-fix-ViewProjMatrix-getProjectionMatrix.patch