Skip to main content

push_branch

Function push_branch 

Source
pub fn push_branch(branch: &str) -> Result<PushResult>
Expand description

Push the current branch to origin with upstream tracking

Uses git push --set-upstream origin <branch> to push the branch and set up tracking. If the branch already exists on remote, it will still push any new commits.

§Arguments

  • branch - The branch name to push

§Returns

  • PushResult::Success - Push completed successfully
  • PushResult::AlreadyUpToDate - Branch is already up-to-date
  • PushResult::Error(msg) - Push failed with error message