Jwno

Help: patch
Login

Help: patch

The "patch" command:

Usage: fossil patch SUBCOMMAND ?ARGS ..?

This command is used to create, view, and apply Fossil binary patches. A Fossil binary patch is a single (binary) file that captures all of the uncommitted changes of a check-out. Use Fossil binary patches to transfer proposed or incomplete changes between machines for testing or analysis.

fossil patch create [DIRECTORY] PATCHFILE

Create a new binary patch in PATCHFILE that captures all uncommitted changes in the check-out at DIRECTORY, or the current directory if DIRECTORY is omitted. If PATCHFILE is "-" then the binary patch is written to standard output.

Options:

-f|--force
Overwrite an existing patch with the same name

fossil patch apply [DIRECTORY] PATCHFILE

Apply the changes in PATCHFILE to the check-out at DIRECTORY, or in the current directory if DIRECTORY is omitted.

Options:

-f|--force
Apply the patch even though there are unsaved changes in the current check-out. Unsaved changes are reverted and permanently lost.
-n|--dry-run
Do nothing, but print what would have happened
-v|--verbose
Extra output explaining what happens

fossil patch diff [DIRECTORY] PATCHFILE
fossil patch gdiff [DIRECTORY] PATCHFILE

Show a human-readable diff for the patch in PATCHFILE and associated with the repository checked out in DIRECTORY. The current directory is used if DIRECTORY is omitted. All the usual diff flags described at "fossil help diff" apply. With gdiff, gdiff-command is used instead of internal diff logic. In addition:
-f|--force
Continue trying to perform the diff even if baseline information is missing from the current repository

fossil patch push REMOTE-CHECKOUT

Create a patch for the current check-out, transfer that patch to a remote machine (using ssh) and apply the patch there. The REMOTE-CHECKOUT is in one of the following formats:

  • DIRECTORY
  • HOST:DIRECTORY
  • USER@HOST:DIRECTORY

The name of the fossil executable on the remote host is specified by the --fossilcmd option, or if there is no --fossilcmd, it first tries "$HOME/bin/fossil" and if not found there it searches for any executable named "fossil" on the default $PATH set by SSH on the remote.

Command-line options:

-f|--force
Apply the patch even though there are unsaved changes in the current check-out. Unsaved changes will be reverted and then the patch is applied.
--fossilcmd EXE
Name of the "fossil" executable on the remote
-n|--dry-run
Do nothing, but print what would have happened
-v|--verbose
Extra output explaining what happens

fossil patch pull REMOTE-CHECKOUT

Like "fossil patch push" except that the transfer is from remote to local. All the same command-line options apply.

fossil patch view PATCHFILE

View a summary of the changes in the binary patch in PATCHFILE. Use "fossil patch diff" for detailed patch content.
-v|--verbose
Show extra detail about the patch