git pull和git merge 都是将其他分支的代码合并到当前分支,那到底在不同场景下具体啥区别呢??
某草草2017-05-02 09:54:42
You will know after using it, git pull = git fetch + git merge
The fetch and push commands can fetch and push the remote branch respectively, but pull does not directly talk to the remote branch.
The difference between fetch and pull is: git fetch: gets the latest version from the remote to the local, and does not automatically merge
And git pull gets the latest version from the remote and merges it into the local warehouse
From a security perspective, git fetch is better than git pull It is safer because we can first compare the differences between local and remote and then merge them selectively.
git push pushes to master by default. If there are multiple branches, multiple branches will be pushed to the remote together