help/diffs.txt
changeset 9999 f91e5630ce7e
parent 9998 4a3c388f8c69
child 10000 16f49d671c7f
equal deleted inserted replaced
9998:4a3c388f8c69 9999:f91e5630ce7e
     1 Mercurial's default format for showing changes between two versions of
       
     2 a file is compatible with the unified format of GNU diff, which can be
       
     3 used by GNU patch and many other standard tools.
       
     4 
       
     5 While this standard format is often enough, it does not encode the
       
     6 following information:
       
     7 
       
     8 - executable status and other permission bits
       
     9 - copy or rename information
       
    10 - changes in binary files
       
    11 - creation or deletion of empty files
       
    12 
       
    13 Mercurial also supports the extended diff format from the git VCS
       
    14 which addresses these limitations. The git diff format is not produced
       
    15 by default because a few widespread tools still do not understand this
       
    16 format.
       
    17 
       
    18 This means that when generating diffs from a Mercurial repository
       
    19 (e.g. with "hg export"), you should be careful about things like file
       
    20 copies and renames or other things mentioned above, because when
       
    21 applying a standard diff to a different repository, this extra
       
    22 information is lost. Mercurial's internal operations (like push and
       
    23 pull) are not affected by this, because they use an internal binary
       
    24 format for communicating changes.
       
    25 
       
    26 To make Mercurial produce the git extended diff format, use the --git
       
    27 option available for many commands, or set 'git = True' in the [diff]
       
    28 section of your hgrc. You do not need to set this option when
       
    29 importing diffs in this format or using them in the mq extension.