What is the significance of the following commands:
git pushgit push origingit push origin master
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.
This command pushes some things from the local repository to a remote repository.
<remote>can be the name of a configured remote or a full URL to a remote git repository.<refspec>, in its general form is an optional+followed by<src>:<dst>where<src>is the name of a local branch, tag or commit id and<dst>is the name of a remote branch or tag to push to. If:<dst>is omitted, it is equivalent to<src>:<src>. This means thatgit push origin masteris equivalent togit push origin master:master. The+is used to attempt non fast-forward pushes.If you don’t supply a remote repository (third parameter), then the configured remote for the current branch (if any) will be used, or
originif none.If you don’t supply a refspec to push (the fourth parameter) then if there is a configured push refspec for the remote being pushed (config variable:
remote.<remotename>.push) then that is used, otherwise the behaviour depends on the setting of the config variablepush.default.The default is
matchingwhich pushes all local branches which match (by name) a remote branch on the remote being pushed to.Other options for
push.defaultarenothing(which does nothing),upstreamortrackingwhich pushes the current branch to its configured upstream branch andcurrentwhich pushes the current branch to an identically named branch on the remote.