Files
30-seconds-of-code/snippets/set-default-push-branch.md
Angelos Chalaris 1397bb792e Deprecate expertise
2022-12-04 22:23:55 +02:00

640 B

title, tags, author, cover, firstSeen
title tags author cover firstSeen
Set default push branch name configuration,branch chalarangelo blog_images/pink-flower.jpg 2021-06-30T05:00:00-04:00

Use the name of the current branch when pushing by default as the name of the remote branch.

  • Use git config push.default current to set the name of the remote branch to the one of the current local branch as the default.
  • You can use the --global flag to configure this option globally.
git config [--global] push.default current
git config --global push.default current

git checkout -b my-branch
git push -u
# Pushes to origin/my-branch