When you push a branch with Magit (with
P P) and the branch has no
upstream, Magit asks you the name of the branch you want to push to.
Once you set the upstream for a branch, however, Magit no longer asks you where you want to push it. This is usually convenient (you don't want to be asked every time), but it makes it difficult to push a branch to a different remote branch.
Is there a way to have Magit ask me again about the destination branch, even if the current branch already has an upstream?
It's quite common that I have a branch like this:
Local: issue-30 ~/Git-Projects/repo/ Remote: issue-30 @ origin (email@example.com:.../repo.git) Head: ebe4054 Some commit message
and I want to change both Local and Remote branches to
issue-30-and-34. If I just rename the Local branch, I'm left with this:
Local: issue-30-and-34 ~/Git-Projects/repo/ Remote: issue-30 @ origin (firstname.lastname@example.org:.../repo.git) Head: ebe4054 Some commit message
Even if I delete
P P on
will simply recreate the
What I end up doing is the following, but it feels rather roundabout for something that can be done in a single
- Create a new branch called
issue-30-and-34(instead of renaming the old one),
- delete both Local and Remote versions of
issue-30-and-34(since it has no upstream yet, Magit will ask me where to push).