Ok, after some digging I got an alias to work. I have no idea why it works when nothing else I tried would but here it is anyway. I think it is best to paste the following into your .git-config file directly:
up = "!git push -u origin `git symbolic-ref --short HEAD`"
or if you have git 2.22
up = "!git push -u origin `git branch --show-current`"
Not specifying the branch still gives me a
Fatal: The current branch has no upstream
. Any ideas why?Did you specify the
-u
flag?Yep, I copied and pasted this exactly
git config --global alias.up 'push -u origin'
yeah, looks like I have the same issue!
Ok, after some digging I got an alias to work. I have no idea why it works when nothing else I tried would but here it is anyway. I think it is best to paste the following into your .git-config file directly:
or if you have git 2.22
I figured this out mostly by messing around with this Stack Overflow answer: stackoverflow.com/a/30529511/9770212