Push
Download ===> https://urluso.com/2tlB4s
When the command line does not specify where to push with the argument, branch.*.remote configuration for thecurrent branch is consulted to determine where to push. If theconfiguration is missing, it defaults to origin.
When the command line does not specify what to push with ...arguments or --all, --mirror, --tags options, the command findsthe default by consulting remote.*.push configuration,and if it is not found, honors push.default configuration to decidewhat to push (See git-config[1] for the meaning of push.default).
When neither the command-line nor the configuration specify what topush, the default behavior is used, which corresponds to the simplevalue for push.default: the current branch is pushed to thecorresponding upstream branch, but as a safety measure, the push isaborted if the upstream branch does not have the same name as thelocal one.
Other ambiguity resolutions might be added in the future, but fornow any other cases will error out with an error indicating what wetried, and depending on the advice.pushUnqualifiedRefnameconfiguration (see git-config[1]) suggest what refs/namespace you may have wanted to push to.
The special refspec : (or +: to allow non-fast-forward updates)directs Git to push \"matching\" branches: for every branch that exists onthe local side, the remote side is updated if a branch of the same namealready exists on the remote side.
Instead of naming each ref to push, specifies that allrefs under refs/ (which includes but is notlimited to refs/heads/, refs/remotes/, and refs/tags/)be mirrored to the remote repository. Newly created localrefs will be pushed to the remote end, locally updated refswill be force updated on the remote end, and deleted refswill be removed from the remote end. This is the defaultif the configuration option remote..mirror isset.
Push all the refs that would be pushed without this option,and also push annotated tags in refs/tags that are missingfrom the remote but are pointing at commit-ish that arereachable from the refs being pushed. This can also be specifiedwith configuration variable push.followTags. For moreinformation, see push.followTags in git-config[1].
GPG-sign the push request to update refs on the receivingside, to allow it to be checked by the hooks and/or belogged. If false or --no-signed, no signing will beattempted. If true or --signed, the push will fail if theserver does not support signed pushes. If set to if-asked,sign if and only if the server supports signed pushes. The pushwill also fail if the actual call to gpg --sign fails. Seegit-receive-pack[1] for the details on the receiving end.
Transmit the given string to the server, which passes them tothe pre-receive as well as the post-receive hook. The given stringmust not contain a NUL or LF character.When multiple --push-option= are given, they areall sent to the other side in the order listed on thecommand line.When no --push-option= is given from the commandline, the values of configuration variable push.pushOptionare used instead.
Imagine that you have to rebase what you have already published.You will have to bypass the \"must fast-forward\" rule in order toreplace the history you originally published with the rebased history.If somebody else built on top of your original history while you arerebasing, the tip of the branch at the remote may advance with theircommit, and blindly pushing with --force will lose their work.
A general note on safety: supplying this option without an expectedvalue, i.e. as --force-with-lease or --force-with-lease=interacts very badly with anything that implicitly runs git fetch onthe remote to be pushed to in the background, e.g. git fetch originon your repository in a cronjob.
Alternatively, specifying --force-if-includes as an ancillary optionalong with --force-with-lease[=] (i.e., without saying whatexact commit the ref on the remote side must be pointing at, or whichrefs on the remote side are being protected) at the time of \"push\" willverify if updates from the remote-tracking refs that may have beenimplicitly updated in the background are integrated locally beforeallowing a forced update.
Note that --force applies to all the refs that are pushed, henceusing it with push.default set to matching or with multiple pushdestinations configured with remote.*.push may overwrite refsother than the current branch (including local refs that arestrictly behind their remote counterpart). To force a push to onlyone branch, use a + in front of the refspec to push (e.g git pushorigin +master to force a push to the master branch). See the... section above for details.
For every branch that is up to date or successfully pushed, addupstream (tracking) reference, used by argument-lessgit-pull[1] and other commands. For more information,see branch..merge in git-config[1].
May be used to make sure all submodule commits used by therevisions to be pushed are available on a remote-tracking branch.If check is used Git will verify that all submodule commits thatchanged in the revisions to be pushed are available on at least oneremote of the submodule. If any commits are missing the push willbe aborted and exit with non-zero status. If on-demand is usedall submodules that changed in the revisions to be pushed will bepushed. If on-demand was not able to push all necessary revisions it willalso be aborted and exit with non-zero status. If only is used allsubmodules will be pushed while the superproject is leftunpushed. A value of no or using --no-recurse-submodules can be usedto override the push.recurseSubmodules configuration variable when nosubmodule recursion is required.
When using on-demand or only, if a submodule has a\"push.recurseSubmodules={on-demand,only}\" or \"submodule.recurse\" configuration,further recursion will occur. In this case, \"only\" is treated as \"on-demand\".
The is used for pushes only. It is optional and defaultsto . Pushing to a remote affects all defined pushurls or to alldefined urls if no pushurls are defined. Fetch, however, will onlyfetch from the first defined url if muliple urls are defined.
For a successfully pushed ref, the summary shows the old and newvalues of the ref in a form suitable for using as an argument togit log (this is .. in most cases, and... for forced non-fast-forward updates).
The remote end refused the update. Usually caused by a hookon the remote side, or because the remote repository has oneof the following safety options in effect:receive.denyCurrentBranch (for pushes to the checked outbranch), receive.denyNonFastForwards (for forcednon-fast-forward updates), receive.denyDeletes orreceive.denyDeleteCurrent. See git-config[1].
But if you try to push, you will attempt to update the branch (thatnow points at A) with commit B. This does not fast-forward. If you didso, the changes introduced by commit A will be lost, because everybodywill now start building on top of B.
If you do not want to lose your work (history from X to B) or the work bythe other person (history from X to A), you would need to first fetch thehistory from the repository, create a history that contains changes doneby both parties, and push the result back.
Alternatively, you can rebase your change between X and B on top of A,with \"git pull --rebase\", and push the result back. The rebase willcreate a new commit D that builds the change between X and B on top ofA.
There is another common situation where you may encounter non-fast-forwardrejection when you try to push, and it is possible even when you arepushing into a repository nobody else pushes into. After you push commitA yourself (in the first picture in this section), replace it with \"gitcommit --amend\" to produce commit B, and you try to push it out, becauseforgot that you have pushed A out already. In such a case, and only ifyou are certain that nobody in the meantime fetched your earlier commit A(and started building on top of it), you can run \"git push --force\" tooverwrite it. In other words, \"git push --force\" is a method reserved fora case where you do mean to lose history.
Without additional configuration, pushes the current branch tothe configured upstream (branch..merge configurationvariable) if it has the same name as the current branch, anderrors out without pushing otherwise.
For example, to default to pushing only the current branch to originuse git config remote.origin.push HEAD. Any valid (likethe ones in the examples below) can be configured as the default forgit push origin.
This is to emulate git fetch run on the mothership using gitpush that is run in the opposite direction in order to integratethe work done on satellite, and is often necessary when you canonly make connection in one way (i.e. satellite can ssh intomothership but mothership cannot initiate connection to satellitebecause the latter is behind a firewall or does not run sshd).
After running this git push on the satellite machine, you wouldssh into the mothership and run git merge there to complete theemulation of git pull that were run on mothership to pull changesmade on satellite.
The fetch and push protocols are not designed to prevent one side fromstealing data from the other repository that was not intended to beshared. If you have private data that you need to protect from a maliciouspeer, your best option is to store it in another repository. This appliesto both clients and servers. In particular, namespaces on a server are noteffective for read access control; you should only grant read access to anamespace to clients that you would trust with read access to the entirerepository.
If set to \"true\" assume --set-upstream on default push when noupstream tracking exists for the current branch; this optiontakes effect with push.default options simple, upstream,and current. It is useful if by default you want new branchesto be pushed to the default remote (like the behavior ofpush.default=current) and you also want the upstream trackingto be set. Workflows most likely to benefit from this option aresimple central workflows where all branches are expected tohave the same name on the remote. 59ce067264