Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dashed opened this issue Feb 9, 2022 · 0 comments
Open

Comments

@dashed
Copy link
Owner

dashed commented Feb 9, 2022

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant