Let us say I run
git push --force origin master:master (forced update)
and at another place
git push origin +master:master (Non fast forward update)
Are these 2 same ? Any scenario where these 2 behave differently ?
They are identical. From the docs:
All of the rules described above about what’s not allowed as an update can be overridden by adding an the optional leading
+to a refspec (or using--forcecommand line option).
However, and perhaps obviously, --force applies to everything that's being pushed, whereas + applies to only that refspec prefixed with the + (master in this case). In the two commands in your question, that doesn't make a difference because there is only one refspec in both of them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With