Skip to content

New config variable push.default

Finn Arne Gangstad git 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesNew
  2. v21 patch 6 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2New config push.default to decide default behavior for pushDocumentation/config.txt builtin-push.c cache.h +2 more+104 -50 replies
2/2Display warning for default git push with no push.default configDocumentation/RelNotes-1.6.3.txt builtin-push.c+30 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] New config variable push.default

Add a new configuration variable push.default that decides what action to take if you do not give "git push" any refspecs, and no refspecs are implied by options (--all or --mirror), and no refspecs are configured for the current remote.

Some minor rewording of error messages since last time, and split the patch into two. Patch 1 introduces the variable with all functionality, and patch 2 adds a warning if the default behavior is trigged and push.default has not been configured.

Possible configuration values are:

- nothing: Do not push anything.

- tracking: Push the current branch to the branch it is tracking. In this mode, push will always push to the same branch that pull would pull from. This functionality does not exist today.

- current: Push the current branch to a branch of the same name on the current remote, create it if it does not exist. Identical to "git push <remote> HEAD", but you do not have to explicitly give the remote.

- matching: The current behavior, push every branch to the current remote if a branch with the same name already exists there.

Finn Arne Gangstad (2):
New config push.default to decide default behavior for push Display warning for default git push with no push.default config

 Documentation/RelNotes-1.6.3.txt |    7 +++
 Documentation/config.txt         |   18 +++++++++
 builtin-push.c                   |   76 +++++++++++++++++++++++++++++++++++--
 cache.h                          |    9 ++++
 config.c                         |   28 ++++++++++++++
 environment.c                    |    1 +
 6 files changed, 134 insertions(+), 5 deletions(-)