What is the difference between doing:
git push -f origin my-branch:my-branch
and
git push origin +my-branch:my-branch
?
What is the difference between doing:
git push -f origin my-branch:my-branch
and
git push origin +my-branch:my-branch
?
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.