13

What is the difference between doing:

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

and

 git push origin +my-branch:my-branch 

?

1 Answer 1

9

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.