Skip to content

git chain push should set upstream automatically if one does not exist #2

@dashed

Description

@dashed

git chain push should set upstream (remote) automatically if one does not exist. This is more smarter than bailing out naively:

git-chain/src/main.rs

Lines 340 to 347 in f51494c

if e.code() == ErrorCode::NotFound {
println!(
"🛑 Cannot push. Branch has no upstream: {}",
self.branch_name.bold()
);
// do nothing
return Ok(false);
}

Do not do this for git chain push --force since it's a dangerous operation.

Bonus: if git chain push --force fails, then suggest that the user run git chain push if upstream (remote) branches are detected to not be set.


Starting points:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions