Show differences in the working tree, between revisions or branches.


bzr diff [FILE...]


Branch/tree to compare from.

-v, --verbose

Display more information.

-F ARG, --format=ARG

Diff format to use.

-q, --quiet

Only display errors and warnings.

-p ARG, --prefix=ARG

Set prefixes added to old and new filenames, as two values separated by a colon. (eg “old/:new/”).


How many lines of context to show.


Use this command to compare files.


Show usage message and options.


Branch/tree to compare to.

-r ARG, --revision=ARG

See “help revisionspec” for details.


Pass these options to the external diff program.

-c ARG, --change=ARG

Select changes introduced by the specified revision. See also “help revisionspec”.

-h, --help

Show help message.


If no arguments are given, all changes for the current tree are listed. If files are given, only the changes in those files are listed. Remote and multiple branches can be compared by using the –old and –new options. If not provided, the default for both is derived from the first argument, if any, or the current tree if no arguments are given.

“bzr diff -p1” is equivalent to “bzr diff –prefix old/:new/”, and produces patches suitable for “patch -p1”.

Note that when using the -r argument with a range of revisions, the differences are computed between the two specified revisions. That is, the command does not show the changes introduced by the first revision in the range. This differs from the interpretation of revision ranges used by “bzr log” which includes the first revision in the range.

Exit values:

1 - changed 2 - unrepresentable changes 3 - error 0 - no change


Shows the difference in the working tree versus the last commit:

bzr diff

Difference between the working tree and revision 1:

bzr diff -r1

Difference between revision 3 and revision 1:

bzr diff -r1..3

Difference between revision 3 and revision 1 for branch xxx:

bzr diff -r1..3 xxx

The changes introduced by revision 2 (equivalent to -r1..2):

bzr diff -c2

To see the changes introduced by revision X:

bzr diff -cX

Note that in the case of a merge, the -c option shows the changes compared to the left hand parent. To see the changes against another parent, use:

bzr diff -r<chosen_parent>..X

The changes between the current revision and the previous revision (equivalent to -c-1 and -r-2..-1)

bzr diff -r-2..

Show just the differences for file NEWS:

bzr diff NEWS

Show the differences in working tree xxx for file NEWS:

bzr diff xxx/NEWS

Show the differences from branch xxx to this working tree:

bzr diff –old xxx

Show the differences between two branches for file NEWS:

bzr diff --old xxx --new yyy NEWS

Same as ‘bzr diff’ but prefix paths with old/ and new/:

bzr diff --prefix old/:new/

Show the differences using a custom diff program with options:

bzr diff --using /usr/bin/diff --diff-options -wu

di, dif

See also:


Previous topic


Next topic


This Page