31
LMagnus
5y

Developer confession.

I always git push a new branch even though I know it will error as there's no upstream, just to copy the full git push with set upstream arguments from the error message.

Comments
  • 1
    I always push along with setting the upstream even though it might have already been set. The alias 'gpohu' for 'git push origin HEAD -u' for the win!
  • 1
    @LMagnus, glad I'm not the only one
  • 6
    # git remote add origin <URL/SSH>
    # git checkout -b feature/yay
    # git push -u origin feature/yay

    I've been doing this way to long to be able to know this from memory.
  • 2
    @C0D4 I know there's better ways. I just don't do them.
  • 0
    Git is so confusing
  • 3
    @PaszaVonPomiot not really, once you understand the structure and stop thinking its a centralised VCS like Subversion.

    If you want something truly fucked, use any Microsoft product for revision control. Visual Source Safe would be an excellent place to start
  • 1
    Another solution: Create your branch on the remote (with Jira for example), then git fetch and checkout the branch you created. No more hassle needed :p
  • 2
    I do it too. But always ponder... if it’s smart enough to tell me what I should do, why not make it a y/n option?
  • 1
    @McDave 100% agree!
  • 0
    Tab completion works for me
  • 0
    Omg dude, just make alias
    `pushu = push -u origin HEAD`
Add Comment