MikroTik Solutions

Maintaining a Local Fork
Login

Maintaining a Local Fork

Because Fossil is a distributed version control system, you can clone this repository, then create a local fork of it with your local changes while still maintaining a tie to the upstream version, allowing you to merge any future changes into your local copy. Setup is simple:

$ fossil clone https://tangentsoft.com/mikrotik
$ cd mikrotik
$ vi bin/backup-routers           # make desired local changes
$ fossil set autosync pullonly    # needed once only
$ fossil ci --branch local -m 'my local changes'

That results in a local clone of the repository backing this public web site but with any local changes stored on a branch called "local". I had you disable the automatic "push" part of Fossil's autosync feature to keep it from attempting to push your local changes back up to this repo since that will currently fail unless you happen to be me, currently the sole authorized committer. Yet, if another person has a clone and says "fossil up", their local clone of the repo will be updated with whatever's changed on the public server. Then, this command:

$ fossil merge trunk

…will attempt to merge upstream changes into your local branch. Unlike Git, this does not perform an automatic commit. Instead, you may then say "fossil diff" to check that the automatic merge did something sensible, test the changes, and only then commit the tested result via "fossil ci". You don't need the --branch argument now because the first time you gave it, Fossil switched that check-out directory to that branch for you. This is also why we must explicitly name "trunk" in the command above: Fossil needs to be told what to merge into this branch.

If you wish to be extra-paranoid, you can use Fossil's private branches feature, but that will only have a useful effect if you eventually do get push capability on this repository. Until then, all of your local branches are effectively private, since push will always fail. The sole useful purpose behind turning off autosync's push step above is to suppress an annoying error message each time Fossil does an autosync due to lack of push permission.

License

This work is © 2022-2025 by Warren Young and is licensed under CC BY-NC-SA 4.0