I am new in
git push -u origin --all
The actual reason is that, in a new repo (git init), there is no branch (no
master, no branch at all, zero branches)
matching' (push all the branches of the same name, creating them if they don't exist),
simple' (push only the current branch, and only if it has a similarly named remote tracking branch on upstream, since git 1.7.11)
In both cases, since the upstream empty repo has no branch:
That means your local first push has no idea:
So you need at least to do a:
git push origin master
But if you do only that, you:
masterbranch on the upstream (now non-empty repo): good.
master' needs to be pushed to upstream (
master' (upstream branch): bad.
That is why it is recommended, for the first push, to do a:
git push -u origin master
That will record
origin/master as a remote tracking branch, and will enable the next push to automatically push
git checkout master git push
And that will work too with push policies '
current' or '
In each case, after the initial
git push -u origin master, a simple git push will be enough to continue pushing master to the right upstream branch.