Skip to main content

Push before the fetch

In the same state, a fresh clone after init, a push before the first fetch says it creates the upstream branch, though the upstream has it already. It sends nothing new: the rebuild produces the two commits the upstream has, so the upstream stays as it was. This is part of #11.

Output​

setup.bash builds this state:

$ build_scenario scenario_init_then_cloned
$ git splice push lib/a
?? lib/a: upstream has no 'main' branch yet -- this push creates it
ok lib/a: pushed f9832ad to main
$ git -C "$UPSTREAM" log --format=%s main
second version
splice: init lib/a

A successful push records what the upstream has now, so the clone sees it as up to date even without a fetch:

$ git splice status
On branch main

up to date lib/a