tags:

views:

48

answers:

1
+4  Q: 

Git push -f vs. +

What is the difference between doing:

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

and

 git push origin +my-branch:my-branch

?

+3  A: 

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.

VonC