From: Yuri Kanivetsky Date: Mon, 16 Dec 2024 16:47:28 GMT Subject: remote..push without dst doesn't behave as documented Message-ID: Hi, > If git push [] without any argument is set to update some ref at the destination with with remote..push configuration variable, : part can be omitted—such a push will update a ref that normally updates without any on the command line. Otherwise, missing : means to update the same ref as the . https://git-scm.com/docs/git-push#Documentation/git-push.txt-ltrefspecgt82308203 The only case I can think of where refspec is not passed via command line and it updates a non-matching branch is when push.default = upstream. But with remote..push without dst it starts updating a matching branch. Either I don't understand what's meant, or it doesn't behave as documented. The second test fails: @test "normally a non-matching ref updates" { start_cloned_repo git config push.default upstream git checkout -b bb git branch -u origin/ba git commit --allow-empty -m b git push assert_equal_refs origin/ba bb } @test "with remote..push without dst happens what happens normally" { start_cloned_repo git config push.default upstream git config remote.origin.push 'refs/heads/*' git checkout -b bb git branch -u origin/ba git commit --allow-empty -m b git push assert_equal_refs origin/ba bb } start_cloned_repo() { (mkrepo) cd "$BATS_TEST_TMPDIR" git clone --bare a a.git git clone a.git b cd b git config push.default upstream git config user.email you@example.com git config user.name "Your Name" } mkrepo() { cd "$BATS_TEST_TMPDIR" mkdir a (cd a git init git branch -m ba git config user.email you@example.com git config user.name "Your Name" git commit --allow-empty -m a) } More details in a gist: https://gist.github.com/x-yuri/943fd13704b38551da36c8363d7852e1 Regards, Yuri