Menu

gitpiper

Set default push branch name git Code Snippet in 2025

configurationbranchintermediate

Last Updated: 24 April 2025

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

git snippet similar to Set default push branch name For You in April 2025

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2025 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️