Diff & Patch: An one minute tutorial

Most of us working in open source projects need to generate modification on a special part of code.

After making changes we need to send it. Only the difference in the file is needed to be sent.

So how to create a difference(diff) file ? Simple .Follow these steps

diff <original dir>X.c <working dir>X.c > “diff file”

Here diff file may be X.c.diff.

X.c is a c language file.

Now if we receive the diff file, how to join(patch) it with our orginal file? See below

patch X.c X.c.diff

Advertisements

Leave a comment

Filed under FOSS, GNU/Linux

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