[Oberon] Reconciling branches in the git repository.

Michael Schierl schierlm at gmx.de
Mon Jun 24 23:42:10 CEST 2024


Hello,

Am 16.06.2024 um 20:36 schrieb peter at easthope.ca:
> Currently the A2 repository has branches main, bohdan and override.
>
> main seems a reasonable choice for me.  Therefore, to update the local
> copy of the repository, did this,
> root at imager:/home/root/A2# git pull origin main
> with this result.
>
> hint: Pulling without specifying how to reconcile divergent branches is
> hint: discouraged. You can squelch this message by running one of the following
> hint: commands sometime before your next pull:
> hint:
> hint:   git config pull.rebase false  # merge (the default strategy)
> hint:   git config pull.rebase true   # rebase
> hint:   git config pull.ff only       # fast-forward only
> hint:
> hint: You can replace "git config" with "git config --global" to set a default
> hint: preference for all repositories. You can also pass --rebase, --no-rebase,
> hint: or --ff-only on the command line to override the configured default per
> hint: invocation.
>
> If a specific branch is pulled, why is reconciliation necessary?

"git pull" will pull changes from a branch and integrate them to your
current working copy. If your working copy currently is not at a state
that is a previous state of the branch you are pulling (e.g. has local
modifications, or was on a different branch altogether), this may result
in a merge or rebase. If you do not want that, you can choose the third
option. If, on the other hand, your working copy is at a previous state
of the working copy you are pulling, the option does not matter and git
will always perform a fast forward.

In case you want to just switch your working copy to match a branch
(discarding the your current working copy commit), you can use "git
checkout" instead.

"SVN update" is similar to "git pull" with using rebase strategy (second
option). Which is (if I recall correctly) the reason why they added this
hint message, as git's default action is the first one and it confused
people with a SVN background.



Regards,


Michael



More information about the Oberon mailing list