Home Explore Blog CI



git

1st chunk of `Documentation/config/push.adoc`
7dcddd65352483d9c62dccfac68c356e6b45c18fb746064e0000000100000a2b
push.autoSetupRemote::
	If set to "true" assume `--set-upstream` on default push when no
	upstream tracking exists for the current branch; this option
	takes effect with push.default options 'simple', 'upstream',
	and 'current'. It is useful if by default you want new branches
	to be pushed to the default remote (like the behavior of
	'push.default=current') and you also want the upstream tracking
	to be set. Workflows most likely to benefit from this option are
	'simple' central workflows where all branches are expected to
	have the same name on the remote.

push.default::
	Defines the action `git push` should take if no refspec is
	given (whether from the command-line, config, or elsewhere).
	Different values are well-suited for
	specific workflows; for instance, in a purely central workflow
	(i.e. the fetch source is equal to the push destination),
	`upstream` is probably what you want.  Possible values are:
+
--

* `nothing` - do not push anything (error out) unless a refspec is
  given. This is primarily meant for people who want to
  avoid mistakes by always being explicit.

* `current` - push the current branch to update a branch with the same
  name on the receiving end.  Works in both central and non-central
  workflows.

* `upstream` - push the current branch back to the branch whose
  changes are usually integrated into the current branch (which is
  called `@{upstream}`).  This mode only makes sense if you are
  pushing to the same repository you would normally pull from
  (i.e. central workflow).

* `tracking` - This is a deprecated synonym for `upstream`.

* `simple` - push the current branch with the same name on the remote.
+
If you are working on a centralized workflow (pushing to the same repository you
pull from, which is typically `origin`), then you need to configure an upstream
branch with the same name.
+
This mode is the default since Git 2.0, and is the safest option suited for
beginners.

* `matching` - push all branches having the same name on both ends.
  This makes the repository you are pushing to remember the set of
  branches that will be pushed out (e.g. if you always push 'maint'
  and 'master' there and no other branches, the repository you push
  to will have these two branches, and your local 'maint' and
  'master' will be pushed there).
+
To use this mode effectively, you have to make sure _all_ the
branches you would push out are ready to be pushed out before
running 'git push', as the whole point of this mode is to allow you
to push all of the branches in one go.  If you usually finish work
on only one branch and push

Title: Git Push Configuration Options
Summary
The text describes Git configuration options related to push behavior, including push.autoSetupRemote and push.default, which control how Git pushes changes to a remote repository when no refspec is given, and outlines the different values and workflows they support.