Warning push.default is unset; its implicit value is changing in Git 2.0
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
The warning push.default is unset; its implicit value is changing in Git 2.0 appears when you run git push without specifying a branch and without having configured the push.default setting. In Git 1.x, the default push behavior was matching — pushing all local branches that have a same-named remote branch. In Git 2.0, this changed to simple — pushing only the current branch and only if it has the same name upstream. The fix is to set push.default explicitly with git config --global push.default simple.
The Warning Message
Fixing the Warning
This sets the configuration in your global ~/.gitconfig file and silences the warning permanently.
All push.default Options
| Option | Behavior | When to Use |
simple | Push current branch to its upstream branch, only if names match | Default since Git 2.0 — safest for most users |
current | Push current branch to a same-named branch on the remote | When you want auto-push without upstream tracking |
upstream | Push current branch to its upstream branch (any name) | When local and remote branch names differ |
matching | Push all branches that have same-named remote branches | Legacy Git 1.x behavior — pushes multiple branches |
nothing | Push nothing unless a refspec is given | Maximum safety — always specify the branch |
Differences in Practice
Setting Up Upstream Tracking
simple requires an upstream branch to be set. If you see fatal: The current branch has no upstream branch:
After the first git push -u, subsequent git push commands work without arguments.
Checking Your Current Configuration
Configuration Levels
Common Pitfalls
- Ignoring the warning and using Git 1.x
matchingbehavior unknowingly: Withmatching, runninggit pushon any branch pushes all branches with matching remote names. You may accidentally push unfinished work from other branches. Settingsimpleexplicitly prevents this. - Confusing
simplewithcurrent:simplerequires an upstream branch to be set and checks that local and remote names match.currentcreates a remote branch with the same name if one does not exist, without requiring upstream tracking. For most workflows,simpleis safer. - Not setting
--globaland wondering why the warning returns:git config push.default simple(without--global) sets the configuration only for the current repository. The warning reappears in other repositories. Use--globalfor a user-wide setting. - Using
matchingin shared repository workflows: In a team environment,matchingcan push branches that are not ready for review. This is especially dangerous if you have local branches tracking shared remote branches. Usesimpleorcurrentinstead. - Forgetting to set upstream with
git push -u: When usingsimple, the first push of a new branch requires-u(or--set-upstream) to establish tracking. Without it,git pushfails with "no upstream branch." Rungit push -u origin branch-nameonce to set it up.
Summary
- Set
git config --global push.default simpleto silence the warning and use the Git 2.0+ default simplepushes only the current branch to its tracking upstream — the safest option for most usersmatching(Git 1.x default) pushes all branches with matching remote names — risky in team environments- Use
git push -u origin branch-nameto set upstream tracking for new branches - Use
currentif you want Git to automatically create remote branches without setting upstream first - The setting can be overridden per-repository with
git config --local push.default

