GitAlias / gitalias

Git alias commands for faster easier version control
2.43k stars 325 forks source link

git topic-move doesn't update upstream branch name #109

Closed GreenEnergyBeam closed 6 months ago

GreenEnergyBeam commented 6 months ago

I used git topic-begin chore-cleanup followed by topic-move chore-dbcontext and then git push I got:


fatal: The upstream branch of your current branch does not match
the name of your current branch.  To push to the upstream branch
on the remote, use

    git push origin HEAD:chore-cleanup

To push to the branch of the same name on the remote, use

    git push origin HEAD

To choose either option permanently, see push.default in 'git help config'.

To avoid automatically configuring an upstream branch when its name
won't match the local branch, see option 'simple' of branch.autoSetupMerge
in 'git help config'.

This makes me think the upstream didn't get renamed. Is it supposed to do so?

phdru commented 6 months ago

IMO topic-move should do git push -u at the last line.

PS. And all topic-* aliases should join lines with &&, not just ; semicolon. But that's a different story. I just looked at them for the 1st time.

joelparkerhenderson commented 6 months ago

Yes good ideas both of you. Want to do a pull request?

phdru commented 6 months ago

110. Many small fixes. The last commit 007b29589 adds --set-upstream, that should fix the problem above.

joelparkerhenderson commented 6 months ago

Perfect, thank you so much. I just merged it.