8

In my iOS Application I want to create a patch file for the modified files to send it to Review Board.How can i generate a patch file in Mac OS by using Terminal

4
  • With the reviewboard, do you mean the AppStore review? That you do not send in a patch but the full app.
    – rckoenes
    Dec 5, 2013 at 10:45
  • not appstore review,i need to send it to Client for the code review through Review Board
    – Jyothi
    Dec 5, 2013 at 10:50
  • If you are using a code repository (like svn or git) you can send them a diff of the two relevant revisions.
    – AlexVogel
    Dec 5, 2013 at 10:56
  • How can i create the diff file from Xcode or from Terminal?
    – Jyothi
    Dec 5, 2013 at 11:00

2 Answers 2

21

If you don't want to use VCS for creating patch then you can use diff tool. You can create patch for one file using

diff -u original.c new.c > original.patch

Or

diff -rupN original/ new/ > original.patch

For entire folder

7
  • I want to create a diff file for the local folder and SVN folder and i'm using Xcode IDE
    – Jyothi
    Dec 5, 2013 at 11:09
  • So, you have original sources in svn folder and your modified sources in another folder, right? Or you changed sources in svn folder?
    – igoris
    Dec 5, 2013 at 11:11
  • If you're using SVN, you can just do <code>svn diff > whatever.patch</code> from your working copy. Dec 5, 2013 at 11:11
  • @igoris Yes i have original sources in SVN and i have modified the local copy and i need diff file of these two
    – Jyothi
    Dec 5, 2013 at 11:14
  • If your modified sources are in the SVN working copy then just use svn diff > whatever.patch (as stated by @Zydeco). If you've copied sources to another folder and then modified them, then use diff command
    – igoris
    Dec 5, 2013 at 11:18
-2

First check in the Xcode Downloads whether the Command Line Tools are downloaded or not. if not first download that and then follow the below procedure

In Terminal go to the directory where we need that Patch File and execute the Command svn diff > somename.patch then you will get a patch file in that directory

2
  • 1
    I know it's 9 years later. I wonder why this is the accepted answer. The OP mentioned nothing about svn
    – akauppi
    Apr 1, 2021 at 8:13
  • I know this is 8 years later. The OP did mention svn in a follow-up comment: stackoverflow.com/questions/20397345/…. "I want to create a diff file for the local folder and SVN folder and i'm using Xcode IDE"
    – Byron
    Jan 11, 2022 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.