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

default remote push selection #1062

Open
mathstuf opened this issue Aug 23, 2023 · 3 comments
Open

default remote push selection #1062

mathstuf opened this issue Aug 23, 2023 · 3 comments

Comments

@mathstuf
Copy link

Reading the docs for git feature:

To Setup a remote tracking branch:

$ git feature dependencies -r upstream

Note: If no remote name is passed with the -r option, it will push to origin.

Should this instead default to what remote.pushDefault is set to?

@hyperupcall
Copy link
Collaborator

Good point - I think it should check remote.pushDefault before defaulting to origin. We might need to make this change repository-wide...

@mathstuf
Copy link
Author

Then again, I'm not sure if that allows the "triangle setup". For example, origin for me is always the "main" repo (I never got the upstream for that and origin for my fork because remote.pushDefault makes the distinction of where to publish, by default, clear). If I have a fork, it is github (or gitlab or whatever) and other forks are gh/$uname. My remote.pushDefault is github, but I do git branch --set-upstream-to=origin/master (or origin/main or whatever makes sense) as this makes vim-fugitive show:

  • what my base branch has that I'm missing
  • what is remote for the branch on my fork and not locally
  • what is on my branch and not in the base branch

which is everything that I find important when working with topic branches.

But that can certainly be a separate issue/effort. Using remote.pushDefault where it makes sense sounds just fine as an incremental change.

@spacewander
Copy link
Collaborator

We can improve the git-feature to select the remote automatically.
PR is welcome!

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

3 participants