Catalog / Fossil Version Control Cheatsheet

Fossil Version Control Cheatsheet

A concise guide to Fossil, the self-contained, distributed version control system. Covering basic commands, repository management, and workflow essentials.

Getting Started with Fossil

Repository Creation & Setup

fossil new <repository-name>.fossil - Creates a new Fossil repository.

Example:
fossil new project.fossil

fossil open <repository-name>.fossil - Opens an existing Fossil repository in the current directory.

Example:
fossil open project.fossil

fossil close - Closes the currently open Fossil repository.

fossil info - Displays information about the currently open repository.

Basic Workflow

fossil add <file>

Adds a new file to the Fossil repository.

fossil commit -m "<commit-message>"

Commits the changes to the local repository with a descriptive message.

fossil update

Updates the local workspace to the latest version from the repository.

fossil changes

Shows the list of changes.

Configuration

fossil set <setting> <value> - Sets a Fossil configuration option.

Example:
fossil set autosync 1 (Enables automatic synchronization)

fossil unset <setting> - Unsets a Fossil configuration option.

fossil config list - Lists all Fossil configuration options.

Branching and Merging

Branch Management

fossil branch new <branch-name>

Creates a new branch.

fossil branch list

Lists existing branches.

fossil checkout <branch-name>

Switches to the specified branch.

fossil update <branch-name>

Updates the local workspace to the specified branch.

Merging Changes

fossil merge <branch-name> - Merges changes from the specified branch into the current branch.

Note: Resolve any conflicts manually after the merge.

fossil commit -m "Merged <branch-name>" - Commits the merged changes.

fossil revert <file> - Reverts changes to a specific file.

Resolving Conflicts

Fossil marks conflicted files with conflict markers. Edit the files to resolve the conflicts manually.

fossil resolved <file> - Marks the conflict as resolved after manual editing.

Remote Operations

Synchronization

fossil clone <url> <repository-name>.fossil

Clones a remote Fossil repository.

fossil sync

Synchronizes changes with the remote repository. It pushes local changes and pulls remote changes.

fossil push

Pushes local changes to the remote repository.

fossil pull

Pulls remote changes to the local repository.

Remote Management

fossil remote add <name> <url> - Adds a remote repository with a specified name and URL.

fossil remote list - Lists all configured remote repositories.

fossil remote remove <name> - Removes a remote repository.

Troubleshooting Sync Issues

Ensure the remote URL is correct and accessible.
Check network connectivity.
Resolve any merge conflicts before pushing changes.

Advanced Fossil Features

Fossil Artifacts

Fossil uses content-addressable storage. Each version of each file is stored as an artifact.

fossil find <artifact-id> - Finds an artifact by its ID.

fossil cat <artifact-id> - Displays the content of an artifact.

Fossil Tickets

fossil ticket new

Creates a new ticket in the Fossil repository.

fossil ticket list

Lists all tickets.

fossil ticket show <ticket-id>

Shows details of a specific ticket.

Fossil Web Interface

fossil ui - Starts the Fossil web interface in your default browser.

The web interface provides access to repository content, history, tickets, and other features.