cybercitizen4@lemm.ee to Asklemmy@lemmy.ml · 1 year agoWhat's a handy terminal command you use often?message-squaremessage-square268linkfedilinkarrow-up1228arrow-down17
arrow-up1221arrow-down1message-squareWhat's a handy terminal command you use often?cybercitizen4@lemm.ee to Asklemmy@lemmy.ml · 1 year agomessage-square268linkfedilink
minus-squareCaveman@lemmy.worldlinkfedilinkarrow-up7arrow-down1·1 year 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 🇦🇺@aussie.zonelinkfedilinkEnglisharrow-up2·1 year agogit push origin HEAD is a slightly shorter way of doing the same thing, even though you have an alias anyway lol
minus-squareJackbyDev@programming.devlinkfedilinkEnglisharrow-up2·1 year agogit config --global alias.pusho 'push --set-upstream origin HEAD' You’re welcome.
minus-squareCaveman@lemmy.worldlinkfedilinkarrow-up1·1 year agoSo that’s making git push always push to the current branch?
minus-squareJackbyDev@programming.devlinkfedilinkEnglisharrow-up1·1 year 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-pushwhich is alias forgit push origin `git branch --show`Which I’m writing on my phone without testing or looking
git push origin HEADis 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 pushalways push to the current branch?When you’re pushing a new branch you’ve never pushed before you need the
-ucommand. That’s what this alias is for.As long as the config’s
push.defaultisn’tmatching,git pushwithout arguments will only push the current branch.