How do you apply patch file downloaded from gerrit?

Fantastic Mr Fox picture Fantastic Mr Fox · Jun 11, 2016 · Viewed 11.7k times · Source

In Gerrit, under the download section for a change, there is a section that allows you to download the Patch-File:

enter image description here

Using git apply results in:

$ git apply 441eb56b.diff.base64
fatal: unrecognized input

What command do I use to apply this patch?

Answer

pestophagous picture pestophagous · Feb 4, 2017
base64 --decode c6a9dcdb.diff.base64 > c6a9dcdb.diff
git apply c6a9dcdb.diff

(Replace c6a9dcdb with whatever abbreviated commit hash Gerrit gave you.)