Is it correct to say that «pull» is kinda «merge»?

喜你入骨 提交于 2020-01-05 05:42:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!