Git push -f vs. +

后端 未结 1 1877
臣服心动
臣服心动 2021-02-19 12:17

What is the difference between doing:

 git push -f origin my-branch:my-branch

and

 git push origin +my-branch:my-branch
         


        
1条回答
  •  走了就别回头了
    2021-02-19 12:43

    Those are two syntaxes for the same goal.

    Except that git push --force can be used when you don't specify any refspec (meaning you want to push your current branch to a remote matching name branch).
    It is easier than:

    git push origin +yourBranch
    

    , as mentioned in the Git Community Book.

    See "Why “git push helloworld +master:master” instead of just “git push helloworld”?" for illustration.

    0 讨论(0)
提交回复
热议问题