问题
Is it correct to say that «push» is kinda «merge»? The only difference, that I see: «merge» is operation on my local branches, «push» is operation between local and remote branch.
Is my understanding right or not?
回答1:
git pull
is an alias to git fetch + git merge
.
git fetch
updates your local repository with the changes (delta) which are downloaded from the remote repository and stored inside your local .git
folder.
Once the fetch is over and you have all the data locally, then git merge
occurs and merges your changes with the one from the remote.
回答2:
git pull
is defined as git fetch + git merge
. So yes, it is merge.
git push
is not a merge of any kind. It just pushes your local commits to a remote destination. If anything goes less than perfect, it refuses to continue.
来源:https://stackoverflow.com/questions/45790483/is-it-correct-to-say-that-pull-is-kinda-merge