git chain push should set upstream (remote) automatically if one does not exist. This is more smarter than bailing out naively:
|
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:
git chain pushshould 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
Do not do this for
git chain push --forcesince it's a dangerous operation.Bonus: if
git chain push --forcefails, then suggest that the user rungit chain pushif upstream (remote) branches are detected to not be set.Starting points: