Integrated: 1304: The 'git skara sync' command often fails

Erik Joelsson erikj at
Thu Jan 13 14:38:20 UTC 2022

On Tue, 11 Jan 2022 21:12:42 GMT, Erik Joelsson <erikj at> wrote:

> This is a partial rework of the rather recent change to "git skara fork" and "git skara sync". That patch tried to protect the user from syncing changes to the wrong host unintentionally, but unfortunately, it turned out to make it a bit too hard.
> With this patch I'm fixing some outright bugs as well as dialing back the protection a little bit. First the clear bugfixes:
> 1. When trying to figure out the official fork parent from the origin, setup and use credentials properly.
> 2. When forking and cloning a repository into a sub directory of an existing local repository, do not set the config in the existing local repository.
> Behavioral changes:
> 1. Do not require --force when explicitly setting --to and/or --from. I believe that if you set those parameters, you are already explicit enough.
> 2. Do require --force whenever the derived to and from do not share the same hostname. This should better catch the sensitive situation when changes are likely to be going the wrong way.
> 3. Since looking up the fork parent from the origin forge is unreliable, only use it when possible and mostly for verification, and only use it as the last option for default from repo.
> So to summarize, here is the expected behavior for choosing the repository from which to sync changes from (this now matches the existing documentation at
> 1. The --from option if set either on the command line or configuration
> 2. A remote named "upstream"
> 3. The fork parent from the origin forge

This pull request has now been integrated.

Changeset: b068ba75
Author:    Erik Joelsson <erikj at>
Stats:     140 lines in 2 files changed: 69 ins; 42 del; 29 mod

1304: The 'git skara sync' command often fails

Reviewed-by: kcr



More information about the skara-dev mailing list