@cybercitizen4@lemm.ee to Asklemmy@lemmy.ml • 11 months agoWhat's a handy terminal command you use often?message-square281fedilinkarrow-up1226
arrow-up1226message-squareWhat's a handy terminal command you use often?@cybercitizen4@lemm.ee to Asklemmy@lemmy.ml • 11 months agomessage-square281fedilink
minus-squareCavemanlinkfedilink7•11 months agog-push which is alias for git push origin `git branch --show` Which I’m writing on my phone without testing or looking
minus-squareCruxil 🇦🇺linkfedilinkEnglish2•11 months agogit push origin HEAD is a slightly shorter way of doing the same thing, even though you have an alias anyway lol
minus-squareJackbyDevlinkfedilinkEnglish2•11 months agogit config --global alias.pusho 'push --set-upstream origin HEAD' You’re welcome.
minus-squareCavemanlinkfedilink1•11 months agoSo that’s making git push always push to the current branch?
minus-squareJackbyDevlinkfedilinkEnglish1•edit-211 months agoWhen you’re pushing a new branch you’ve never pushed before you need the -u command. That’s what this alias is for. As long as the config’s push.default isn’t matching, git push without arguments will only push the current branch.
g-push
which is alias forWhich I’m writing on my phone without testing or looking
git push origin HEAD
is a slightly shorter way of doing the same thing, even though you have an alias anyway lolgit config --global alias.pusho 'push --set-upstream origin HEAD'
You’re welcome.
So that’s making
git push
always push to the current branch?When you’re pushing a new branch you’ve never pushed before you need the
-u
command. That’s what this alias is for.As long as the config’s
push.default
isn’tmatching
,git push
without arguments will only push the current branch.