Changes

Jump to navigation Jump to search
Line 107: Line 107:     
It is preferable that you generate your patch from the root directory of your project.
 
It is preferable that you generate your patch from the root directory of your project.
 +
 +
=== How do I apply a patch? ===
 +
 +
First, take a look at what changes are in the patch. You can do this easily with '''git apply''' f.e:
 +
 +
git apply --stat sugar_fixes.patch
 +
 +
Note that this command does not apply the patch, but only shows you the stats about what it’ll do. After opening the patch file with your favorite editor, you can see what the actual changes are.
 +
 +
Next, you’re interested in how troublesome the patch is going to be. Git allows you to test the patch before you actually apply it.
 +
 +
git apply --check sugar_fixes.patch
 +
 +
If you don’t get any errors, the patch can be applied cleanly. Otherwise you may see what trouble you’ll run into. To apply the patch, we can  use '''git am''' instead of '''git apply'''. The reason for this is that git am allows you to sign off an applied patch. This may be useful for later reference.
 +
 +
git am --signoff
 +
 +
Taken from: [http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/]
    
=== How do I send a patch to a maintainer? ===
 
=== How do I send a patch to a maintainer? ===

Navigation menu