Skip to main content

create_branch_from_remote

Function create_branch_from_remote 

Source
pub fn create_branch_from_remote(
    repo: &Repository,
    branch: &str,
    remote: &str,
) -> Result<()>
Expand description

Create local branch branch from remote’s tracking ref and set its upstream.

The single place where a local branch is materialized from a remote tracking branch — keeping creation and upstream wiring together so no caller can get one without the other. Used by add_worktree when it resolves the remote itself, and by callers that resolved an ambiguous remote (e.g. by prompting).