Miroslav Suchý wrote:
> When I make SPDX statistics I have git checkout of all dist-gits and do
> git-pull every two week there. This morning I found that two times I got
> an error:
> 
> hint: Diverging branches can't be fast-forwarded, you need to either:
> hint:
> hint: git merge --no-ff
> hint:
> hint: or:
> hint:
> hint: git rebase
> hint:
> hint: Disable this message with "git config advice.diverging false"
> fatal: Not possible to fast-forward, aborting.
> Could not execute pull: Failed to execute command.
> 
> I was under the impression that our dist-git can have only forward
> commits.

You should always (from all upstreams, no matter whether they allow force 
pushes or not) pull with rebase (git pull --rebase). This rebases your 
local, not yet pushed, changes on top of the upstream changes. Since it does 
not change the upstream history, only your local unpushed one, it should 
never require a force-push and hence always be safe. And it works even if 
the upstream has been force-pushed (which should never happen in Fedora, but 
can be an issue in other projects).

A pull with fast-forward only will fail if you have local changes, as you 
can see above. A pull with merge will create a merge commit. The pull with 
rebase is the cleanest option.

        Kevin Kofler
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to