79596340

Date: 2025-04-28 11:18:46
Score: 1
Natty:
Report link

How about a git alias? Set one up to create the branch, and push immediately with the remote branch name you want. Your local and remote branch names can be separate parameters. Something along the lines of

git config --global alias.newbranch '!f() { git checkout -b "$1" && git push -u origin "$1:$2"; }; f'

And then you use it with git newbranch local-branch-name remote-branch-name

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): How
  • Low reputation (0.5):
Posted by: Miroslav Vasilev