search

Home  >  Q&A  >  body text

svn - What is the difference between git pull and git merge?

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??

ringa_leeringa_lee2804 days ago1075

reply all(2)I'll reply

  • 某草草

    某草草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

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-02 09:54:42

    git pull = git fetch + git merge
    少用git pull多用git fetch

    reply
    0
  • Cancelreply