Why do I need to do `--set-upstream` all the time?

后端 未结 21 2351
南方客
南方客 2020-11-22 09:15

I create a new branch in Git:

git branch my_branch

Push it:

git push origin my_branch

Now say someone mad

21条回答
  •  暖寄归人
    2020-11-22 09:24

    This is my most common use for The Fuck.

    $ git push
    fatal: The current branch master has no upstream branch.
    To push the current branch and set the remote as upstream, use
    
        git push --set-upstream origin master
    
    $ fuck
    git push --set-upstream origin master [enter/↑/↓/ctrl+c]
    Counting objects: 9, done.
    ...
    

    Also, it's fun to type swear words in your terminal.

提交回复
热议问题