Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you apply patch file downloaded from gerrit?

Tags:

git

gerrit

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?

like image 222
Fantastic Mr Fox Avatar asked Jun 10 '16 22:06

Fantastic Mr Fox


People also ask

What is patch set in Gerrit?

Gerrit uses the Change-Id to associate each iteration of the commit with the same change. These iterations of a commit are referred to as patch sets. When a change is approved, only the latest version of a commit is submitted to the repository. It is also possible to copy a Change-Id to a completely new commit.


Video Answer


1 Answers

base64 --decode c6a9dcdb.diff.base64 > c6a9dcdb.diff
git apply c6a9dcdb.diff

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

like image 107
pestophagous Avatar answered Oct 12 '22 09:10

pestophagous