Git - What is the difference between push.default “matching” and “simple” - Fleek IT Solutions
15729
single,single-post,postid-15729,single-format-standard,ajax_fade,page_not_loaded,,qode-title-hidden,qode-content-sidebar-responsive,qode-theme-ver-9.5,bridge-shared-by-themes24x7-com,wpb-js-composer js-comp-ver-4.11.1,vc_responsive
Fleek IT Solutions: github-matching-simple

Git – What is the difference between push.default “matching” and “simple”

Struggling with git push.default, not sure what is the difference between push.default “matching” and “simple”. Hope this blog will helps you out! Lets start with what is git push?

git push - can push all branches or a single one dependent on this configuration:

Configuration 1 – Push all branches

git config --global push.default matching

It will push all the branches to the remote branch and would merge them. If you don’t want to push all branches, you can push the current branch only.

Configuration 2: Push only the current branch

git config --global push.default simple

It will push branches one by one. It Mostly connected with current branch.

It will push all the branches to the remote branch and would merge them. If you don’t want to push all branches, you can push the current branch only.

push.default

Defines the action git push should take if no refspec is explicitly given. Possible values are:

  1. nothing – do not push anything (error out) unless a refspec is explicitly given. This is primarily meant for people who want to avoid mistakes by always being explicit.
  2. 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.
  3. 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).
  4. simple – in centralized workflow, work like upstream with an added safety to refuse to push if the upstream branch’s name is different from the local one.
  5. 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.
No Comments

Post A Comment