What is the difference between doing:
git push -f origin my-branch:my-branch
and
git push origin +my-branch:my-branch
?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Those are two syntaxes for the same goal.
Except that
git push --forcecan 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:
, as mentioned in the Git Community Book.
See “Why “git push helloworld +master:master” instead of just “git push helloworld”?” for illustration.