DEV Community

Discussion on: Simplify pushing to git

jpgrefaldo profile image
John Paul Grefaldo • Edited on

Sorry I've no idea, I've tried.
Alt text of image

when

git config --global push.default upstream

what's your config?

Thread Thread
jpgrefaldo profile image
John Paul Grefaldo

From what I understand, I think it will only work if it was push successfully before or branch exist in remote?
https://git-scm.com/docs/git-push#Documentation/git-push.txt--u
ref: git-scm.com/docs/git-push#Document...

Thread Thread
koffeinfrei profile image
Alexis Reigel

what's your config?

I haven't set that config, I use the default (i.e. push.default=simple). For me git push origin -u works.

Setting git config --global push.default upstream I get the same error as you.

The OP suggested to use git config --global push.default current though, which has the desired effect (i.e. git push sets the remote branch as the tracking branch).