difference between git merge origin/master and git pull

后端 未结 3 1604
天涯浪人
天涯浪人 2020-12-22 17:14

I\'m working on a local branch \"BDD-local\" and would like to get the changes from other developers. The other developers are using their own branch and once they are happ

3条回答
  •  感情败类
    2020-12-22 17:40

    git pull is the same as git fetch + git merge

    The command

    git pull  
    

    is really just the same as

    git fetch 
    git merge /
    

    So there is no practical difference between

    git pull origin master
    

    and

    git fetch origin
    git merge origin/master
    

    Documentation

    As stated in the official Linux Kernel git pull documentation:

    In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD.

    More precisely, git pull runs git fetch with the given parameters and calls git merge to merge the retrieved branch heads into the current branch.

    Recommended Reading

    • Pro Git § 2.5 Git Basics - Working with Remotes - Fetching and Pulling from Your Remotes.

提交回复
热议问题