Fossil User Forum

How to use two different systems with a repo on each that stays in sync
Login

How to use two different systems with a repo on each that stays in sync

How to use two different systems with a repo on each that stays in sync

(1) By Doug (doug9forester) on 2025-05-17 21:27:59 [link] [source]

I use Windows for my editing and my VPS to drive my web page. I have a fossil repo on each (Windows cloned the VPS repo) and identical source trees. I want to keep the repos in sync and have the ability to update each separately and have the change reflected in the other. I have the ability to keep the source trees in sync using this on Windows:

fossil patch push VPS_URL:VPS_DIR -f
When I checkin a file on Windows, autosync updates the VPS repo. I can use 'fossil update' on the VPS to update the source tree. So far so good.

However, when I checkin a changed file on VPS (which was not changed on Windows), fossil does not behave the same way - the Windows repo is not updated. And I can't do anything on the Windows system without fossil trying to fork:

==>fossil ci obs-editor.php
Pull from ssh:VPS_URL//VPS_REPO
Round-trips: 1   Artifacts sent: 0  received: 0
Pull done, wire bytes sent: 435  received: 869  remote: VPS_URL
Would fork.  "update" first or use --branch or --allow-fork.
Why does fossil think that a fork would be created? And what can I do to tell fossil that a fork would not be created - just update the repo and let me use "fossil update" to sync my source tree.

Is there a different way to configure everything that would allow me to have repos absolutely in sync and allow updates from both systems?

(2.1) By Andy Bradford (andybradford) on 2025-05-17 23:35:52 edited from 2.0 in reply to 1 [link] [source]

> Why does fossil think that a fork would be created?

Because you must  have made a commit from the  other repository and have
not yet updated. You are given three choices:

> "update" first or use --branch or --allow-fork.

In this case you probably just want to update.  So just run:

fossil update
fossil ci obs-editor.php

Fossil knows that there exists another commit from the same point in the
"tree" or DAG and needs you to make a decision on how to resolve this.

For more information, you might read:

https://fossil-scm.org/home/doc/trunk/www/branching.wiki

Andy

(3) By Andy Bradford (andybradford) on 2025-05-17 23:35:23 in reply to 1 [link] [source]

> Is there a  different way to configure everything that  would allow me
> to have repos absolutely in sync and allow updates from both systems?

I  think  how you  have  it  configured  should  work. You're  just  not
following the standard workflow. See section 4.0 here:

https://fossil-scm.org/home/doc/trunk/www/concepts.wiki

And also  specifically section  4.1 which discusses  how to  use "fossil
update" to keep things current in your working checkouts.

Andy

(4) By anonymous on 2025-05-18 18:06:47 in reply to 1 [link] [source]

... I want to keep the repos in sync and have the ability to update each separately and have the change reflected in the other

What's missing in your set up is the remote attribute set on the VPS-side repo and pointing at the Windows side repo URL. autosync is on by default, but check that it's set up on both ends.

## on VPS side do:
fossil remote https://windows.server/repo   ## or whatever is the way your Windows-side repo is served
fossil set autosync on

This way repos on both ends refer to each-other, a change on one side will propagate/autoupdate to the other side. Of course, the repo should be served on both ends, unless you handle this via SSH or over the file-system.

Assuming the repos are not actively used at the same time on both ends (and time is reasonably sync'ed), this set up would minimize forking and keep both ends sync'ed.

(5) By Stephan Beal (stephan) on 2025-05-18 18:27:04 in reply to 1 [source]

fossil patch push VPS_URL:VPS_DIR -f

Tip: since 2.26, patch supports aliases, so you can do:

$ fossil patch alias add v VPS_URL:VPS_DIR
$ fossil patch push v
$ fossil patch pull --force v