-
Notifications
You must be signed in to change notification settings - Fork 6k
git: Check push config before falling back to branch remote #41700
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks! According to the docs it seems like we should be able to use |
|
@cole-miller seems like we could use: git rev-parse --abbrev-ref @{push}But it requires remote tracking set up for that branch, so it won't work for new branches being pushed for the first time. Wdyt?
|
|
It's okay if we don't select a remote automatically when the branch has no upstream and there's no git configuration indicating where it should be pushed--we have a fallback to open a picker for this situation (if that |
@cole-miller yeah, looks like it does. It goes in this order:
Here's a screenshot from my tests
Note that my Here's when
|
|
Thanks for the information! I think it makes sense that we'd honor The other thing is that I think we should separate out a |
1e47078 to
9816409
Compare
Nope, I think that's all.
Makes sense, I've updated it but instead of creating a separate function I added a |
|
Hmm, I think maybe a better structure would be
And then push the fallback to "get all remotes" to the callers--how does that sound? |



Closes #26649
Release Notes: