Git pull and git merge both merge the code of other branches into the current branch, so what are the specific differences in different scenarios??
某草草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