{"thread":{"id":"60031","subject":"--force-if-includes only works if local and remote brach names are the same","startedAt":"2023-07-26T19:07:31Z","lastAt":"2023-07-26T19:07:31Z","messageCount":1,"participants":["Stefan Haller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"479914","messageId":"f51c73ed-eb03-83ca-fb31-d3e2645c9a63@haller-berlin.de","threadId":"60031","inReplyTo":null,"subject":"--force-if-includes only works if local and remote brach names are the same","fromName":"Stefan Haller","fromEmail":"lists@haller-berlin.de","sentAt":"2023-07-26T19:02:09Z","receivedAt":"2023-07-26T19:07:31Z","isPatch":false,"sender":{"key":"lists@haller-berlin.de","avatar":null},"body":"The --force-if-includes option of git push only seems to work if my\nlocal ref matches the name of the remote ref that I'm pushing to. It\nwould be nice if I could also use it if that's not the case.\n\nFor example:\n\n  git checkout -b main-myremote myremote/main\n  git push -u myremote main-myremote:main\n  # Hack hack hack, rebase rebase\n  git push --force-if-includes --force-with-lease\n\nThis fails, as it does the check_if_includes_upstream check against the\nlocal main, which is unrelated.\n\n(Cc'ing a few people who were involved in the review of the patch series\nthat introduced the --force-if-includes option.)\n\n-Stefan\n"}]}