MikroTik Solutions

Maintaining a Local Fork
Login

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'

Now you have a clone of the repository backing this public web site but with your local changes on a branch called "local". The automatic "push" part of Fossil's autosync feature is disabled so it doesn't attempt to push your local changes back up to this repo, causing an error each time since you almost certainly do not have push privileges here. Yet, if you say "fossil up", your local clone of the repo will be updated with whatever's changed on the public server, so that this command:

$ fossil merge trunk

…will attempt to merge upstream changes into your local branch. You can then say "fossil diff" to check the automatic merge, test the changes, and then commit 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 only reason we turned off push on autosync above is to suppress an annoying error message each time Fossil does an autosync.

License

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