Members

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:

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.
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).
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.
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.

https://www.fleekitsolutions.com/difference-between-push-default-ma...

Views: 6

Comment

You need to be a member of On Feet Nation to add comments!

Join On Feet Nation

© 2024   Created by PH the vintage.   Powered by

Badges  |  Report an Issue  |  Terms of Service