diff¶
vb diff|gdiff [OPTIONS] [FILE1] [FILE2 ...]
Description¶
Show the difference between the current version of each of the FILEs specified (as they exist on disk) and that same file as it was checked- out. Or if the FILE arguments are omitted, show all unsaved changes currently in the working check-out. The gdiff variant means to to use a GUI diff.
The default output format is a unified patch (the same as the
output of diff -u on most unix systems). Many alternative formats
are available. A few of the more useful alternatives:
--tk Pop up a Tcl/Tk-based GUI to show the diff
--by Show a side-by-side diff in the default web browser
-b Show a linear diff in the default web browser
-y Show a text side-by-side diff
--webpage Format output as HTML
--webpage -y HTML output in the side-by-side format
The --from VERSION option is used to specify the source check-in
for the diff operation. If not specified, the source check-in is the
base check-in for the current check-out. Similarly, the --to VERSION
option specifies the check-in from which the second version of the file
or files is taken. If there is no --to option then the (possibly edited)
files in the current check-out are used. The --checkin VERSION option
shows the changes made by check-in VERSION relative to its primary parent.
The --branch BRANCHNAME shows all the changes on the branch BRANCHNAME.
With the --from VERSION option, if VERSION is actually a directory name
(not a tag or check-in hash) then the files under that directory are used
as the baseline for the diff.
The -i command-line option forces the use of VisionByte’s own internal
diff logic rather than any external diff program that might be configured
using the setting command. If no external diff program is configured,
then the -i option is a no-op. The -i option converts gdiff into
diff.
The --diff-binary option enables or disables the inclusion of binary files
when using an external diff program.
The --binary option causes files matching the glob PATTERN to be treated
as binary when considering if they should be used with the external diff
program. This option overrides the binary-glob setting.
These command show differences between managed files. Use the vb xdiff command to see differences in unmanaged files.
Options¶
- --binary PATTERN¶
Treat files that match the glob PATTERN as binary
- --branch BRANCH¶
Show diff of all changes on BRANCH
- --brief¶
Show filenames only
- -b, --browser¶
Show the diff output in a web-browser
- -ci, --checkin VERSION¶
Show diff of all changes in VERSION
- --command PROG¶
External diff program. Overrides
diff-command
- -c, --context N¶
Show N lines of context around each change, with negative N meaning show all content
- --dark¶
Use dark mode for the Tcl/Tk-based GUI and HTML
- --diff-binary BOOL¶
Include binary files with external commands
- --exec-abs-paths¶
Force absolute path names on external commands
- --exec-rel-paths¶
Force relative path names on external commands
- -r, --from VERSION¶
Use VERSION as the baseline for the diff, or if VERSION is a directory name, use files in that directory as the baseline.
- -w, --ignore-all-space¶
Ignore white space when comparing lines
- -i, --internal¶
Use internal diff logic
- --invert¶
Invert the diff
- --json¶
Output formatted as JSON
- -n, --linenum¶
Show line numbers
- --disable-color-diff¶
Don’t color diff line
- --numstat¶
Show the number of added and deleted lines per file, omitting the diff. When combined with
--brief, show only the total row.
- -y, --side-by-side¶
Side-by-side diff
- --strip-trailing-cr¶
Strip trailing CR
- --tk¶
Launch a Tcl/Tk GUI for display
- --to VERSION¶
Select VERSION as target for the diff
- --undo¶
Use the undo buffer as the baseline
- --unified¶
Unified diff
- -v, --verbose¶
Output complete text of added or deleted files
- -h, --versions¶
Show compared versions in the diff header
- --webpage¶
Format output as a stand-alone HTML webpage
- -W, --width N¶
Width of lines in side-by-side diff
- -Z, --ignore-trailing-space¶
Ignore changes to end-of-line whitespace
- --diff-coding ENCODE¶
Decode input and encode files as given
ZIP Diff Options¶
- --zip-tree¶
ZIP diff output in a tree view
- --zip-unified¶
ZIP diff output in unified diff format
- --zip-unchanged¶
Include unchanged entries in ZIP diff output
- --zip-edited¶
Include edited entries in ZIP diff output
- --zip-added¶
Include added entries in ZIP diff output
- --zip-deleted¶
Include deleted entries in ZIP diff output
- --zip-headers¶
Include headers in ZIP diff output
- --date FORMAT¶
ZIP diff date format: iso, short, rfc
- --zip-exact¶
Exact comparison for ZIP files
- --zip-all¶
Include all types of entries in ZIP diff output
Examples¶
Init and open a repository
$ vb init diff_repo.vbyte
project-id: 7199040dec2525a97befd31b9b0f4f87b0840f6a
server-id: 807488c80b4667f2d5ad83770afdcfa6da527074
admin-user: ubuntu (initial remote-access password is "RH5ha74SDc")
$ vb open -f diff_repo.vbyte
project-name: <unnamed>
repository: /tmp/sphinx_tests/ed6a8ed1/diff_repo/diff_repo.vbyte
local-root: /tmp/sphinx_tests/ed6a8ed1/diff_repo/
config-db: /tmp/sphinx_tests/ed6a8ed1/.visionbyte
project-code: 7199040dec2525a97befd31b9b0f4f87b0840f6a
checkout: 0aa4f7f2ba67aa36dd035bb8d18b8d1c4d01b0ef 2026-04-07 06:51:20 UTC
tags: trunk
comment: initial empty check-in (user: ubuntu)
check-ins: 1
Add and commit a file
$ vb sys echo "file 1 line1" > file.txt
$ vb sys echo "file 2 line1" > file2.txt
$ vb add file.txt file2.txt
ADDED file.txt
ADDED file2.txt
$ vb ci -m "Initial commit"
Committed version: dd40ff0c683b6843d6e49e26c74c0f17134078a1b25582d9c20d6576fd644bf8
Edit the file and show diff
$ vb sys echo "file 1 line2" >> file.txt
$ vb sys echo "file 2 line2" >> file2.txt
$ vb diff file.txt
Index: file.txt
==================================================================
--- file.txt
+++ file.txt
@@ -1,1 +1,2 @@
file 1 line1
+file 1 line2
Show unified diff for all changes
$ vb diff
Index: file.txt
==================================================================
--- file.txt
+++ file.txt
@@ -1,1 +1,2 @@
file 1 line1
+file 1 line2
Index: file2.txt
==================================================================
--- file2.txt
+++ file2.txt
@@ -1,1 +1,2 @@
file 2 line1
+file 2 line2