LinuxCommandLibrary

fossil-forget

Remove historical artifacts from Fossil repository

TLDR

View documentation for the original command

$ tldr fossil rm
copy

SYNOPSIS

fossil forget CHANGESET-ID

PARAMETERS

CHANGESET-ID
    The unique identifier of the changeset to forget. This can be a full SHA1 hash, a short hash, or a tag/branch name that resolves to a changeset.

--force
    Bypass the confirmation prompt.

--keep
    Instead of deleting the named changesets, delete all changesets except the ones named.

DESCRIPTION

The fossil forget command removes change history from a local Fossil repository.
This is a destructive operation that permanently deletes data, making it impossible to recover forgotten changesets. It's primarily used for purposes like:

  • Shrinking repository size after removing large, unnecessary files from history.
  • Cleaning up development branches that are no longer relevant.
  • Sanitizing a repository before open-sourcing (with extreme caution).
Use with caution, always create a backup before execution.
fossil forget only affects the local repository. It does not modify remote repositories. To propagate these changes, a fresh synchronization needs to happen, which involves pushing the remaining artifacts after the forget operation to the remote repository.
The command will prompt for confirmation unless the --force option is provided.

CAVEATS

fossil forget is irreversible. Always back up your repository before using this command. Forgetting changesets can create inconsistencies if synchronization is not done carefully. Be mindful of dependencies and ensure the repository remains in a valid state after the operation. Forgetting a changeset does not delete related artifacts that it introduced. However, these orphaned artifacts can be deleted afterwards.

SYNCHRONIZATION IMPLICATIONS

After running fossil forget, subsequent synchronizations with remote repositories will be affected. Pushing changes after forgetting will essentially rewrite the remote repository's history, removing the forgotten changesets. Pulling from a remote repository without first pushing local changes can lead to conflicts and data loss if the remote repository contains the forgotten changesets. It is generally recommended to push local changes after a fossil forget operation, then have other users synchronize from that point forward.

SEE ALSO

fossil sync(1), fossil clean(1), fossil gc(1)

Copied to clipboard