Linux Scroll

Just another WordPress.com site

Apply patch file in linux

Use dry-run before apply patch:

$ patch --dry-run -p1 -i 000-fixed.patch

patching file coding.cpp

dry-run = simulate patch

If no error, apply the patch file:

$ patch -p1 -i 000-fixed.patch

patching file coding.cpp

Failure output:

$ patching file 000-fixed.patch

Hunk #1 FAILED at 819.

$ patch -p0 < fixed.patch
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: