Skip to main content

push_upstream_with_rebase

Function push_upstream_with_rebase 

Source
pub fn push_upstream_with_rebase(repo_root: &Path) -> Result<(), GitError>
Expand description

Push HEAD to upstream, rebasing on non-fast-forward rejections.

If the branch has no upstream yet, this will create one via git push -u origin HEAD. When the push is rejected because the remote has new commits, this will:

  • git fetch origin --prune
  • git rebase <upstream>
  • retry push with a bounded number of attempts