What is the difference between doing:
git push -f origin my-branch:my-branch
and
git push origin +my-branch:my-branch
?
git pull is one of many commands that claim the responsibility of 'syncing' remote content. The git remote command is used to specify what remote endpoints the syncing commands will operate on. The git push command is used to upload content to a remote repository.
Simply, we can say that git push command updates the remote repository with local commits. And origin represents a remote name where the user wants to push the changes.
git push is most commonly used to publish an upload local changes to a central repository. After a local repository has been modified a push is executed to share the modifications with remote team members.
A "pull request" is you requesting the target repository to please grab your changes. A "push request" would be the target repository requesting you to push your changes.
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.
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