From the Git Push.Default Documentation ,
Defines the action git push should take if no refspec is given (whether from the command-line, config, or elsewhere). Different values are well-suited for specific workflows; for instance, in a purely central workflow (i.e. the fetch source is equal to the push destination), upstream is probably what you want. Possible values are:
nothing
- do not push anything (error out) unless a refspec is given. This is primarily meant for people who want to avoid mistakes by always being explicit.
current
- push the current branch to update a branch with the same name on the receiving end. Works in both central and non-central workflows.
upstream
- push the current branch back to the branch whose changes are usually integrated into the current branch (which is called @{upstream}). This mode only makes sense if you are pushing to the same repository you would normally pull from (i.e. central workflow).
simple
- in centralized workflow, work like upstream with an added safety to refuse to push if the upstream branch’s name is different from the local one.
So you can do below and set it to
git config --global push.default current